Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Prevent loading bar from moving backwards#150

Open
mcoetzee wants to merge 1 commit intochieffancypants:masterfrom
mcoetzee:backwards-prevention
Open

Prevent loading bar from moving backwards#150
mcoetzee wants to merge 1 commit intochieffancypants:masterfrom
mcoetzee:backwards-prevention

Conversation

@mcoetzee
Copy link
Copy Markdown

Following from pull request #119 - this solution seems to work nicely (and caters for the scenario you explained in the PR-119).

Another thing to note is that I fixed the issue where the loading-bar gets removed from the DOM before it has the chance to move through to 100% width.

Lastly (and importantly) - I can't get the unit tests to pass with this change. The 'leave' method of animate returns nothing on line 234 which prevents the status to be set back to 0 (via the '_completeAnimation' function). Could you please assist in getting these tests to run!

@chieffancypants
Copy link
Copy Markdown
Owner

Really appreciate the work here! I noticed, however, that subsequent requests end up freezing the loading bar (it no longer ticks randomly). Are you seeing that as well?

@mcoetzee
Copy link
Copy Markdown
Author

mcoetzee commented Jan 5, 2015

Likewise - this is a rad library so I'm happy to help. Hmm... so my test case is the following:

  1. I fire off one request (1s response time)
  2. On completion of request I immediately fire off another one (3s response time)

Result: the bar no longer moves backwards but instead carries on moving forwards and finally to 100% when the request returns. FYI I then test distinct requests, which triggers the loading bar to move forward as expected to 100%.

Ok so I'm not getting this freezing behaviour you are experiencing. I'm on Mac testing in Chrome, Firefox and Safari. How exactly are you getting this unwanted freezing behaviour?

@groteck
Copy link
Copy Markdown

groteck commented Mar 25, 2015

+1

1 similar comment
@bluesliverx
Copy link
Copy Markdown

+1

@kierzniak
Copy link
Copy Markdown

+1 @mcoetzee Loading bar doesn't move backward but transition which was fading out loading bar seems to doesn't work with this code. Do you have the same behaviour?

@EmmanuelPREVOST
Copy link
Copy Markdown

+1 ...

@ryankc33
Copy link
Copy Markdown

ryankc33 commented Jul 12, 2016

+1

Code works perfectly for me.

Wsiegenthaler added a commit to Wsiegenthaler/angular-loading-bar that referenced this pull request Oct 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants