JedWatson / JedWatson/react-select

Lack of disabled attribute on select element causing color contrast issue

Open
#5,550 0 comments 2 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

When isDisabled is set to true, the disabled attribute is correctly added to the <input> element that makes up react select.

https://codesandbox.io/s/codesandboxer-example-forked-dsc99j

image

Unfortunately, the actual select element (or rather the div that represents the select) is not properly identified as disabled and, as a result, tools like Accessibility Insights for Web complain that color contrast requirements are not met. Color contrast requirements do not need to be met for disabled controls, but tools are not seeing the select as disabled because it is not marked up properly.

image

This can be solved by added aria-disabled="true" to the control--is--disabled node.

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

Use the linked CodeSandbox reproduction and inspect the select's control--is--disabled node in the rendered markup. Check the result with Accessibility Insights for Web, and consider the issue complete when the disabled select is marked with aria-disabled="true" and the contrast warning no longer treats it as enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.