-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
next(false) in beforeEach pushes state when using the browser forward button #2814
Labels
Comments
Hi, do you guys have a workaround for this issue? |
posva
moved this from Long term road (high prio, low complex)
to Design proposals + discussion (high prio, high complex)
in Longterm
Jan 15, 2020
@eyalhakim Did you modify the reproduction example? Can't reproduce. |
In my very specific case it is not beforeEnter(to, from, next) {
if (!isCool(to)) {
mutateMakeCool(to);
// Instead of this:
// const newTo = getCool(to);
// return next(newTo);
}
next();
} |
posva
added
the
fixed on 4.x
This issue has been already fixed on the v4 but exists in v3
label
Feb 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
3.0.1
Reproduction link
https://codesandbox.io/s/vue-routing-example-mjmxd
Steps to reproduce
Click on "goodbye"
Click back in browser
Click forward in browser
last url is pushed into history
What is expected?
In ensureUrl, we need to pass false instead of true to make sure current (out-of-sync) url is replaced and not pushed to history
What is actually happening?
The next function passes true to the ensureUrl function thus making it push the out-of-sync url to history
The text was updated successfully, but these errors were encountered: