Set aria-selected="false" on deselected items#76
Set aria-selected="false" on deselected items#76JanMiksovsky wants to merge 4 commits intoPolymerElements:masterfrom
Conversation
…or which become deselected (rather than removing the attribute).
…or which become deselected (rather than removing the attribute). Fixes PolymerElements#75.
| * deselected. | ||
| */ | ||
| _resetTabindices: function() { | ||
| _resetItemAttributes: function() { |
There was a problem hiding this comment.
One underscore indicates protected for us (two indicates private). This technically constitutes a breaking API change. If we can verify it's not being overridden in elements we control that depend on this behavior, it's probably fine..
There was a problem hiding this comment.
As far as I can see, the only references to _resetTabindices are in iron-menu-behavior.html itself. This also seems like an unusual function for someone to override.
If you'd prefer to play it safe, I could preserve the _resetTabindices name, by either: 1) using the old name for the new function (which does more than reset tab indices) or, 2) creating a new _resetItemAttributes that calls both the old _resetTabindicies and does the new work.
As @giltza noted in the original issue on paper-tabs, the
aria-selectedattribute should be set to "false" for deselected items, not removed.This PR handles two situations: 1) ensures that all items start out with
aria-selected="false"by default, 2) setsaria-selected="false"when a individual item is explicitly deselected.I've tested this fix under the indicated Windows screen reader, NVDA, and confirmed that paper-tabs now works as expected:
aria-selectedattribute.)