-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix(vue-app): always finish transition.leave asynchronously #5891
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #5891 +/- ##
=======================================
Coverage 95.68% 95.68%
=======================================
Files 82 82
Lines 2689 2689
Branches 690 690
=======================================
Hits 2573 2573
Misses 98 98
Partials 18 18
Continue to review full report at Codecov.
|
@pi0 @atinux One consideration that we might take away from this issue is that Nuxt.js fully relies on the asynchronous nature of transition resolving to prevent page components to be loaded twice when switching layouts. Not sure if this was an explicitly known thing or not, it took me quite a while at least to discover that ;) |
Good catch @pimlie, these transitions makes it harder to work with the layouts actually, as well as the scrollBehaviour. |
Fix: #5703
Types of changes
Description
When
transition.css = false
and no leave listener with a callback/done argument is provided, the leave transition callback is called synchronously.This causes a problem when switching layouts in Nuxt. Eg given page A with layout A and page B with layout B the following roughly happens (thus with
transition.css = false
):By calling the leave callback in step 6/7 asynchronous (as would happen when eg transition.css is not false), all subsequent steps are called before the leave callback is called which means that Layout B will already be loaded and Page B is never loaded in Layout A.
Checklist: