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

client: make spectrum respect changed the current color #1269

Merged
merged 2 commits into from
May 30, 2021
Merged

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented May 30, 2021

For some reason, the initial value is no longer taken from the background colour (if it ever was). Let’s pass the colour to spectrum to have it selected instead of the terrible hardcoded colour.

The downside is that changing a colour (and closing the popover) will cause the spectrum instance to be torn down and re-created. But the other simple alternative of caching the initial colour using React.useState would prevent updating the selected value from tag synchronization API response.

For some reason, the initial value is no longer taken from the background colour (if it ever was).
Let’s pass the colour to spectrum to have it selected instead of the terrible hardcoded colour.

The downside is that changing a colour (and closing the popover) will cause the spectrum instance to be torn down and re-created.
But the other simple alternative of caching the initial colour using React.useState would prevent updating the selected value from tag synchronization API response.
@jtojnar jtojnar merged commit 57225ee into master May 30, 2021
@jtojnar jtojnar deleted the fix-picker branch May 30, 2021 11:24
@jtojnar jtojnar added this to the 2.19 milestone May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant