Skip to content

[progress] Progress Bar Doesn't Update within Loops #1937

Discussion options

You must be logged in to vote

This is not a bug in Fomantic, but the nature of Javascript and browser handling. The DOM won't be updated by the browser until the current running Javascript ends. As you are triggering the Progress multiple times inside a running loop, only the final result will be shown when the outer for loop ends.

Two technical solutions:

Use requestAnimationFrame... But this is, according to your example, still too fast as it will wait for the next vsync of your graphics card, but you can at least see it will handle the progress update individually.
https://jsfiddle.net/lubber/r056x7td/15/

Use setTimeOut to handle each progress update in a separate js context. This shows every progress update accord…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ashbaldry
Comment options

Answer selected by lubber-de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1936 on March 28, 2021 17:17.