select icon indicating copy to clipboard operation
select copied to clipboard

fix: allow rendering all options inside list box for better screen reader experience

Open GrigorM opened this issue 3 years ago • 3 comments

Currently only the active item and the adjacent ones are rendered inside [role="listbox"]. This is problematic for screen readers, because they will announce an item as "Option 2 of 3" (3 options in total, current one is second), when it might be option 5 of 10. To fix this, all the options must be present inside [role="listbox"], so that screen readers know the full length of options and the position of the current one.

Not sure why it is implemented the way it is now, so I added the feature as an optional prop, although i think this should be the default way it works.

GrigorM avatar Aug 01 '22 16:08 GrigorM

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
select ✅ Ready (Inspect) Visit Preview Sep 1, 2022 at 4:27PM (UTC)

vercel[bot] avatar Aug 01 '22 16:08 vercel[bot]

Closes #852

GrigorM avatar Nov 07 '22 15:11 GrigorM

would also really like to see this merged as the current behavior makes it very difficult to write tests against the options that are rendered using RTL's screen.getByRole('option')

vitosamson avatar Nov 08 '22 15:11 vitosamson