Skip to content

Commit

Permalink
fix: fix dropdown aria-labelledby from its anchor id
Browse files Browse the repository at this point in the history
  • Loading branch information
ncoden committed Jan 7, 2018
1 parent 9fcea0f commit 8bad6ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/foundation.dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ class Dropdown extends Positionable {
this.$parent = null;
}

// Do not change the `labelledby` if it is defined
var labelledby = this.$element.attr('aria-labelledby')
|| this.$currentAnchor.attr('id')
|| GetYoDigits(6, 'dd-anchor');

this.$element.attr({
'aria-hidden': 'true',
'data-yeti-box': $id,
'data-resize': $id,
'aria-labelledby': this.$currentAnchor.id || GetYoDigits(6, 'dd-anchor')
'aria-labelledby': labelledby
});

super._init();
this._events();
}
Expand Down

0 comments on commit 8bad6ed

Please sign in to comment.