-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Modified the Knobs onChange debounce function so that knob storage occurs on keypress but rendering waits until debouncing has completed #6022
Conversation
…urs but the force rendering is debounced. Debouncing waits 325ms to allow for a user to finish a thought before rendering. Tested this change in the cli projects.
Codecov Report
@@ Coverage Diff @@
## next #6022 +/- ##
==========================================
- Coverage 34.92% 33.98% -0.95%
==========================================
Files 648 651 +3
Lines 9517 9478 -39
Branches 1352 1345 -7
==========================================
- Hits 3324 3221 -103
- Misses 5576 5642 +66
+ Partials 617 615 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@shilman When upgrading to the most recent commit, I get the following error when clicking on the Knobs tab:
|
For now the only version working correctly for me is 5.0.0. |
@kristremblay, when you say latest commit, do you mean the most recent published next version - 5.1.0-alpha.4? |
@CodeByAlex Sorry, yes,. After installing |
No worries @kristremblay. Thanks for your feedback:) This pr hasn’t been published yet even though it has been merged into the next branch. If you are seeing new errors popping up when upgrading to alpha.4, I would suggest that you open a new issue with your finding. This PR will be published soon and should help with the original issue you brought up. |
Thanks, @CodeByAlex , for the time being I'll probably just stick with 5.0.0 and upgrade later :) |
Can we add global configuration for debounce time? |
…bouncing Modified the Knobs onChange debounce function so that knob storage occurs on keypress but rendering waits until debouncing has completed
Issue: #6005
What I did
Modified the component force render debounce so that knob storage still occurs on keypress but the force rendering is debounced. In the 5.0.1 version, the debouncing rate is 150ms which is a little faster than the average typing speed. The change in this PR sets the debouncing rate at 325ms so that the component renders when the user has completed their thought. Frameworks render at different speeds and waiting longer reduces glitchiness. I tested this change in the CLI project to ensure that characters were not being removed as seen in Vue projects.
*I chose 325ms because I felt that it was long enough to reduce glitchiness but not too long to cause frustration. If people believe that this time is too long or too short, please comment below so that we can resolve before merging this in.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.
@shilman @kristremblay @kylepeeler