JedWatson / JedWatson/react-select

Checked Disabled Option should not be removable

Open
#5,904 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

Are you reporting a bug or runtime error?

Bug

https://codesandbox.io/p/sandbox/react-select-v5-sandbox-forked-fpmwhp

Disabled + checked option should not be uncheckable in any way.
(Same as a disabled option is not "checkable" in any way.)

Reproduction:

The CodeSandbox features a checked disabled option ("Red") which cannot be unselected by clicking on it.

It can however be "unchecked" by pressing backspace in the input.
It can also be "unchecked" by clicking the MultiValueRemove button.
It can also be "unchecked" by selecting it with the arrow keys on the keyboard and either pressing space or enter.

However the disabled option cannot be "checked" again after that using the described methods above.

Summary

A disabled option cannot be checked, so it a disabled+checked option IMHO should also not be uncheckable.

Many thanks in advance for looking into it.

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 with the linked CodeSandbox reproduction and inspect the selection/removal behavior around the disabled checked option, including the MultiValueRemove control and keyboard interactions. Done means a disabled option that is already checked remains selected when backspace, removal, space, or enter would otherwise uncheck it, while the reported reproduction no longer occurs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.