Open majornista opened 3 years ago
For when we investigate the root causes / solutions, this is relating to docsearch v2, not v3 (which possibly also has issues, but it would surprise me if it's the same).
Thanks a lot for filing @majornista!
@Haroenv Pretty sure v3 will exhibit similar problems.
The default DocSearch autocomplete implementation returns results to a listbox that incorrectly implements the WAI-ARIA 1.2 ComboBox design pattern.
What is the current behavior?
[role="option"]
contain a template that rendersa[href]
elements, which results in nested interactive controls.[role="option"]
and[aria-selected]
should be applied to thea[href]
rather than the containing element.[aria-activedescendant]
on theinput[role="combobox"]
should be one of thea[href][role="option"]
elements.a[href]
elements should not all have the same[aria-label="Link to the result"]
attribute, which makes it impossible to distinguish between the suggestions.div
andspan
elements within the[role="listbox"]
element should have[role="presentation"]
, to maintain proper semantic structure for the listbox.[role="listbox"]
. A listbox can only contain options or groups of options as children.What is the expected behavior?
Here are the event handlers I added to fix these problems in the rendered DOM: