Autocomplete with groups throws accessibility scanner issues #42782
Labels
accessibility
a11y
component: autocomplete
This is the name of the generic UI component, not the React module!
Steps to reproduce
Link to live example
Steps:
Note: you may need to force the autocomplete to stay open while you scan with
open={true}
Current behavior
I get a bunch of errors around incorrect aria roles:
This is because
<li />
are not allowed as children oflistbox
.The current role structure is:
Expected behavior
No accessibility errors.
To achieve this, you should follow the ARIA APG Listbox pattern which forms this role structure:
This can be achieved in html like this
In my case, I achieved this in the Autocomplete component with fully custom rendering (
renderOption
,renderGroup
), but I wouldn't expect most users to do this.Context
I was trying to create a grouped autocomplete list.
My company is a paying customer, our support key / order number is
65425
Your environment
npx @mui/envinfo
Search keywords: autocomplete accessibility roles
The text was updated successfully, but these errors were encountered: