Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On initial load, the color picker preview color is incorrect #4

Closed
torrobinson opened this issue May 24, 2021 · 2 comments
Closed

On initial load, the color picker preview color is incorrect #4

torrobinson opened this issue May 24, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@torrobinson
Copy link

torrobinson commented May 24, 2021

In my own and your own example code, the first time the color picker is shown, it doesn't represent the current value.

For example, in your demo code, when I click the #FFFFFF background color, the <div> with the color preview always defaults as green (#45FDA9) despite being set to #FFFFFF:

image

image

This appears to be because the .color-picker element does not receive scoped color variable overrides until after its first use. See the element when the color picker is opened, vs after the color is touched for the first time:
image

It's missing the HSLA values until the color is adjusted, and probably needs them set to the current value when opened.

Great little library BTW! I love it and plan to use it in the future.

@yairEO yairEO added the bug Something isn't working label May 26, 2021
@yairEO
Copy link
Owner

yairEO commented May 26, 2021

Awesome thanks for the kind words and I will fix it today!

The color picker it also my own component: https://github.com/yairEO/color-picker

@yairEO
Copy link
Owner

yairEO commented May 27, 2021

fixed https://github.com/yairEO/knobs/releases/tag/v1.2.3

@yairEO yairEO closed this as completed May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants