fix(vue-app): use child transition name when navigating to parent #6946
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of changes
Description
After #6803 fixed the issue i reported about child transition properties, i discovered that also the transition name did not work correctly when leaving a child route to its parent.
I've created a quick demo to show the problem: https://mllwe.sse.codesandbox.io/
If you enter a child route from its parent (ie: B -> BB ) you can see the correct transition applied ( rotation + fade-in ).
If you leave the child route and return to its parent ( ie: BB -> B ), instead of using the child route transition ( rotation + fade-out ), you see the default page transition applied ( swipe to the right ).
This is particularly bad when you use child routes to open modals, as the opening animation works correctly while the leave animation does not.
This PR provides a fix for this scenario, along with some E2E tests to assure that page transitions name and callbacks merging do not break in the future.
This is the same demo with the fix applied: https://ghdkd.sse.codesandbox.io/
Checklist: