-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Provide a general summary of the issue here
If the Swatch contains color #000
, there is no way to unselect it.
This is due to: https://github.com/adobe/react-spectrum/blob/main/packages/react-aria-components/src/ColorSwatchPicker.tsx#L44
See CodeSandBox link at bottom for a better explanation.
🤔 Expected Behavior?
The value should accept null
or undefined
and properly handle that.
😯 Current Behavior
<ColorSwatchPicker>
<ColorSwatch color={"#000"} />
<ColorSwatch color={"#F00"} />
</ColorSwatchPicker>
Will show #000
as selected.
💁 Possible Solution
The value should accept null
or undefined
and properly handle that.
🔦 Context
I have a ColorSwatchPicker
where the list of colors is user defined. I know the hacky workaround is to just set the value to a non-existent color in the list, but that's very wrong.
🖥️ Steps to Reproduce
Here's a CodeSandBox outlining a couple issues with the current implementation:
https://codesandbox.io/p/sandbox/exciting-waterfall-h66ngf
Version
latest
What browsers are you seeing the problem on?
Other
If other, please specify.
all
What operating system are you using?
mac
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response