Skip to content

fix(progressbar): use dynamic transition for fast value updates#19419

Open
Will-Smith-007 wants to merge 1 commit into
primefaces:masterfrom
Will-Smith-007:bugfix/fast-progressbar-value-updates
Open

fix(progressbar): use dynamic transition for fast value updates#19419
Will-Smith-007 wants to merge 1 commit into
primefaces:masterfrom
Will-Smith-007:bugfix/fast-progressbar-value-updates

Conversation

@Will-Smith-007
Copy link
Copy Markdown
Contributor

The root cause is in the CSS:

.p-progressbar-determinate .p-progressbar-value {                                                                     
      transition: width 1s ease-in-out;                                                                                 
}

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

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.

ProgressBar Displays Incorrectly for Updates in Short intervals

1 participant