Skip to content

[Solid] Color picker in controlled mode doesn't update blacks #2894

@teidesu

Description

@teidesu

🐛 Bug report

Screen.Recording.2025-12-12.at.02.52.39.mov

💥 Steps to reproduce

  1. open the ark-ui solid stackblitz demo
  2. open the picker
  3. click within the area and drag down, try moving the mouse left/right
  4. 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

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:

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions