Skip to content
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

beforeRouteUpdate next() fires too early when re-visiting routes within "out-in" transition #1372

Closed
henwen opened this issue Apr 25, 2017 · 1 comment
Labels

Comments

@henwen
Copy link

henwen commented Apr 25, 2017

Version

2.5.2

Reproduction link

https://jsfiddle.net/hwdearborn/y9xqgz1c/4/

Steps to reproduce

  1. Click "to /", you will see "This is A"
  2. Click 'to B", you will see "This is B"
  3. Click 'to /" or use Back Button, you will see "This is"

Also note the console logs, which show how the order of the next() callback is different on the return visit (Step 3 above)

What is expected?

Without the "out-in" option on the transition, beforeRouteEnter's next() callback is fired after Component A is mounted, and its data is properly set.

What is actually happening?

With the "out-in" option on the transition, beforeRouteEnter's next() callback is fired before Component A's beforeCreate event, causing the data to get overriden with its default (empty) value


I came across this issue while trying to add an out-in transition to the Fetching Before Navigation
example from the docs.

@henwen henwen changed the title beforeRouteUpdate next() fires too early when re-visiting route with "out-in" transition beforeRouteUpdate next() fires too early when re-visiting routes within "out-in" transition Apr 25, 2017
@kilobyte2007
Copy link

I have the same issue, any updates on it? I would consider it a bug, in 2.2.0 it was working perfectly.
Here is my fiddle: http://jsfiddle.net/2rwvw17L/3/
Steps to reproduce: Go to /home, then go to /e/1, then again to /home, then again to /e/1.
We see there is not data set the seconds time because the vm object in the next callback is actually the old view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants