JedWatson / JedWatson/react-select

Unable to change the role of select

Open
#5,746 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello,
My company is using react-select but we need to change the role because of certain conflicts with the role being set to combobox. When we add the prop role="listbox" into the component, it continues to show 'combobox', and there seems to be no way around this. Is there perhaps something we are missing or are we unable to change the role right now?

The version we're using is 5.7.4.

Here is an example:

      <RSelect
        {...inputAttributes}
        aria-label={generatedAriaLabel}
        unstyled
        role="listbox"
        // rest of code...

What dev tools shows:

image

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

Reproduce the supplied RSelect example with react-select 5.7.4 and inspect the rendered role in browser dev tools. Trace where the component's role is selected and add or update coverage for the requested role behavior. Done means the documented role prop produces the intended rendered role without breaking the select behavior.

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.