-
-
Notifications
You must be signed in to change notification settings - Fork 233
Description
🐛 Bug report
Screen.Recording.2025-12-12.at.02.52.39.mov
💥 Steps to reproduce
- open the ark-ui solid stackblitz demo
- open the picker
- click within the area and drag down, try moving the mouse left/right
- notice how the color doesn't update
note that this doesn't reproduce in uncontrolled mode (i.e. using defaultValue)
💻 Link to reproduction
https://ark-ui.com/docs/components/color-picker#controlled, the Solid one
🧐 Expected behavior
the color updates normally
🧭 Possible Solution
the issue seems to lie in this equality check
zag/packages/machines/color-picker/src/color-picker.machine.ts
Lines 49 to 51 in 33393b7
| isEqual(a, b) { | |
| return a.toString("css") === b?.toString("css") | |
| }, |
when changing between technically the same color (black) but with different saturation, .toString("css") always returns hsla(0, 0%, 0%, 1) regardless of saturation:
a possible solution might be to replace css mode with hsb (since that's technically how the color is represented internally), but idk if that might break something else (e.g. with different color modes)
🌍 System information
| Software | Version(s) |
|---|---|
| Zag Version | 5.30.0 |
| Browser | Chrome 142 |
| Operating System | macOS |
📝 Additional information
the issue can also be reproduced with svelte, vue and react seem to be fine