Skip to content

Commit

Permalink
Tabindex added to target for 501 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Graham Walker committed May 15, 2016
1 parent cf3ab3b commit 294c56d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions addon/components/tooltip-on-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default EmberTetherComponent.extend({

duration: 0,
effect: 'slide', // fade, slide, none
event: 'hover', // hover, click, focus, ready, or none
event: 'hover', // hover, click, focus, none
hideOn: null,
role: 'tooltip',
side: 'top',
Expand Down Expand Up @@ -181,6 +181,7 @@ export default EmberTetherComponent.extend({
this._super(...arguments);

const event = this.get('event');
const $target = $(this.get('target'));
const _tether = this.get('_tether');
const $_tether = $(_tether.element);

Expand All @@ -189,7 +190,6 @@ export default EmberTetherComponent.extend({
if (event !== 'none') {
const _hideOn = this.get('_hideOn');
const _showOn = this.get('_showOn');
const $target = $(this.get('target'));

/* If show and hide are the same (e.g. click), toggle
the visibility */
Expand Down Expand Up @@ -238,6 +238,11 @@ export default EmberTetherComponent.extend({
});
}

$target.attr({
'aria-describedby': `#${this.get('elementId')}`,
tabindex: $target.attr('tabindex') || this.get('tabindex'),
});

/* When this component has rendered we need
to check if Tether moved its position to keep the
element in bounds */
Expand Down

0 comments on commit 294c56d

Please sign in to comment.