JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.42k stars 4.1k forks source link

Checked Disabled Option should not be removable #5904

Open SetupCoding opened 1 month ago

SetupCoding commented 1 month ago

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.