react-autosuggest
react-autosuggest copied to clipboard
Add aria-label prop for listbox element
Our accessibility audit revealed that an aria-label
attribute was required on the search results listing given by the ul[role=listbox
element. These changes make it possible to pass this down as an optional prop.
So here you seem to re-use some commits from PR #645... This PR might be easier to review if you did it all in one commit that includes an updated README and also new tests.
Especially, the README-change you cherry-picked from #645 is no longer accurate. Here you change the aria-label of the <ul>
s, but #645 changed the aria-label of the <input>
search box...
I understand we use inputProps
to pass attributes to the <input>
... So perhaps we could need a new, similar, top-level prop to pass attributes to the <ul>
s, say listboxProps
?
@hugoholgersson you are right on all counts. Thanks for looking. I'll take care of that soon as possible
Looks promising. Any chance to see that PR merged? @sbeam
Without this fix, it’s impossible for a react-autosuggest implementation to be "WAI-ARIA compliant" as it says on the tin. Would be great to get this merged, as well as removing the extra listbox
on the parent container (#701, #830).
In the meantime here is an alternative: https://github.com/moroshko/react-autosuggest/issues/778#issuecomment-941747116.