Fixes invalid aria-owns/ activedescendant attributes on BasePicker#4552
Conversation
| suggestedDisplayValue={ suggestedDisplayValue } | ||
| aria-activedescendant={ activeDescendant } | ||
| aria-owns='suggestion-list' | ||
| aria-owns={ !!this.state.suggestionsVisible ? 'suggestion-list' : '' } |
There was a problem hiding this comment.
this.state.suggestionsVisible [](start = 30, length = 29)
I don;t think you really need to use the !! prefix
There was a problem hiding this comment.
True, because it's a ternary. Removing.
|
@joschect, are you good with this? |
|
Change overall LGTM, but one minor nit given the spec https://www.w3.org/WAI/PF/aria-1.1/states_and_properties#aria-owns
So an empty string for the value when the suggestion list is not shown may be invalid. Though my WAVE extension doesn't seem to flag it when testing. Might be better to return |
| suggestedDisplayValue={ suggestedDisplayValue } | ||
| aria-activedescendant={ activeDescendant } | ||
| aria-owns='suggestion-list' | ||
| aria-owns={ this.state.suggestionsVisible ? 'suggestion-list' : '' } |
There was a problem hiding this comment.
Should we use undefined rather than blank string?
There was a problem hiding this comment.
I would also prefer undefined if that will work.
|
Yes |
Pull request checklist
$ npm run changeDescription of changes
Fixes aria-owns issue on BasePicker. Aria-owns should only be set to "suggestion-list" when suggestions are rendered.
Focus areas to test
N/A