react-autosuggest icon indicating copy to clipboard operation
react-autosuggest copied to clipboard

Add aria-label prop for listbox element

Open sbeam opened this issue 3 years ago • 4 comments

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.

sbeam avatar Oct 06 '20 15:10 sbeam

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 avatar Oct 08 '20 13:10 hugoholgersson

@hugoholgersson you are right on all counts. Thanks for looking. I'll take care of that soon as possible

sbeam avatar Oct 15 '20 16:10 sbeam

Looks promising. Any chance to see that PR merged? @sbeam

mlp73 avatar Nov 30 '20 16:11 mlp73

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.

thibaudcolas avatar Oct 12 '21 23:10 thibaudcolas