fix(progressbar): use dynamic transition for fast value updates#19419
Open
Will-Smith-007 wants to merge 1 commit into
Open
fix(progressbar): use dynamic transition for fast value updates#19419Will-Smith-007 wants to merge 1 commit into
Will-Smith-007 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The root cause is in the CSS:
When the value increments faster than 1 second, each Angular binding update starts a new CSS transition from the current visual position (not the previous data value). So the bar perpetually lags — at 50%, it may visually only be at e.g. 20% because each 1s animation was interrupted mid-way.
To fix the issue of fast updates, I implemented a simple 1-second timeout strategy. If the previous value update occurred less than a second ago, the transition property is temporarily overridden to a 100 ms ease-in-out animation. Otherwise, it uses the standard CSS transition defined above. I have written some tests that should also help to understand the written code.
closes #19224