-
Notifications
You must be signed in to change notification settings - Fork 3k
Infinite $digest when cancel route change with hash in the URL #2185
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
Comments
It sounds like a very edge case. Have you tried using the locationChangeStart even as well since you are modifying the url outside of ui-router? |
I don't think it's that edge of a case: I need to be able to stop a route change if the user has not saved a form, yet I want to use anchors to jump down to sections on a long form. Using |
Can you reproduce this without having to add the hash to the url manually? |
I'm not sure what you mean—how else can I add the hash? The Plunker provided adds the hash via |
@OverZealous your plunker is expired (don't link to run.plnkr). Can you try this preview of 0.2.16 release? I suspect it will fix your problem. Reopen if that's not the case. See also #2238 |
Sorry about the plunkr! Here's the Plunkr, it's a little more advanced To recreate the issue: click on Add Hash, then check the Prevent Routing checkbox. Finally, click on either Go to B link. Both the added hash and the cancellation must happen, or the refresh doesn't occur. Note that I'm testing on Firefox, in case that changes things. I won't reopen this as it's not affecting me right now, and I'm not 100% sure it's not an issue with the Plunkr. Plus it might be a different issue. |
… has started Closes angular-ui#2238 Closes angular-ui#2229 Closes angular-ui#2185 Closes angular-ui#2236 Closes angular-ui#2098 Closes angular-ui#600
This requires a bit of setup, but the error can be reproduced here consistently:
Plunker
http://run.plnkr.co/blvlkopDhSwhTwUw/
Setup
html5mode
$stateChangeStart
that cancels the transition on some event (in my case, I am using it to prevent navigating away with unsaved changes)I've tried desperately narrowing down the error, but it the closest I can get is that somehow the
$browser
is seeing a URL change, even though the URL doesn't change. I think it's related to$urlRouter.update()
, which is triggering a$location.url()
change.Other notes:
$urlRouter.update()
before the cancellation did not seem to help.$location.hash
, but this occurs even if you manually add the hash to the URL, or usehistory.replaceState
.I'm currently able to work around this issue, but it's rather serious when it happens, because it causes the entire application to crash in my case.
The text was updated successfully, but these errors were encountered: