JedWatson / JedWatson/react-select

[BUG] "Grouped" options breaks screen readers

Open
#4,277 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

category/accessibility issue/bug-confirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Using the "grouped" feature breaks screen readers.

Because group sub-component elements exist as the first item underneath menuList; aria readers will think that the dropdown list contains however many group elements there are, NOT however many option items there are, like it should.

image

To reproduce

  1. Navigate to the "Grouped" example on the main react-select homepage: https://react-select.com/home
    image
  2. Focus the grouped example element with NVDA (or JAWS) enabled.
  3. Click spacebar to open the menu.
  4. Click down the the keyboard arrow keys until the option "Purple" is selected.
  5. Screen-reader will call out that the element is in position "0 of 2" despite the fact that there are 14 items in the list and purple is the third member of that list; it should read "3 of 14".

It's saying 0 of 2 because it's counting the number of group elements under menuList (Colors and Flavors), not the Options nested further down inside Group.

Note> Adding role="presentation" to group may fix this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the grouped select implementation, especially the Group and menuList elements, and reproduce the issue from the Grouped example on react-select.com/home with NVDA or JAWS. Verify that the grouped options are exposed as one list and that selecting Purple is announced as 3 of 14 rather than 0 of 2.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.