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

Controls: Throttling makes Color control lagging #22615

Merged
merged 2 commits into from
May 15, 2024

Conversation

gitstart
Copy link
Contributor

@gitstart gitstart commented May 18, 2023

Closes #22473

What I did

  • Replace throttle with debounce in Color control

How to test

Demo

Screen.Recording.2023-05-12.at.07.48.00.mov

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
@gitstart-storybook gitstart-storybook marked this pull request as ready for review May 18, 2023 10:57
@JReinhold JReinhold self-assigned this May 18, 2023
@ndelangen ndelangen changed the title fix: Throttling makes Color control lagging Controls: Throttling makes Color control lagging Nov 28, 2023
@ndelangen
Copy link
Member

@JReinhold WDYT?

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this, it's way smoother. Should have been merged a long time ago. Thanks ❤️

@JReinhold JReinhold merged commit 879f979 into storybookjs:next May 15, 2024
49 of 50 checks passed
@github-actions github-actions bot mentioned this pull request May 15, 2024
13 tasks
@valentinpalkovic valentinpalkovic added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 5, 2024
@ghengeveld
Copy link
Member

This doesn't seem entirely resolved, but it's much better now. If we want to take another stab at it, I suggest ignoring global state value updates (args) while the color picker is being manipulated.

I think the actual problem is that the color picker updates args, and this value is later synced back to the color picker. This is usually more or less instant and very close or equal to the actual selected color, so it doesn't really jump. The debounce/throttle causes a delay in the update and therefore may cause the color picker to jump back to an earlier value. If we disable this sync back to the picker if a new color was selected recently (<= debounce time), then this should remove the jitter altogether.

@valentinpalkovic valentinpalkovic removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Color control is buggy since v7
5 participants