fix: allow rendering all options inside list box for better screen reader experience
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.
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) |
Closes #852
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')