-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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(Transition): handle KeepAlive child unmount in Transition out-in mode #11833
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
@vue/reactivity
commit: |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
edison1105
commented
Sep 6, 2024
@@ -515,6 +516,7 @@ function getInnerChild(vnode: VNode): VNode | undefined { | |||
|
|||
export function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void { | |||
if (vnode.shapeFlag & ShapeFlags.COMPONENT && vnode.component) { | |||
vnode.transition = hooks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
close #11775
Problems in #11775
The out-in animation fails when switching from
pc
topa
.pb
andpc
will be unmounted. It is expected that only theafterLeave
ofpc
will be executed, but theafterLeave
ofpb
is also being executed, causingpa
to be rendered twice and resulting in the animation not working as expected. (TheafterLeave
ofpb
should not be executed again)afterLeave
should be destroyed after performed.pc
was removed frominclude
, but it was not unmounted.current
is stillpc
inpruneCacheEntry
, so failed to unmountpc
.current
tonull
when patchingemptyPlaceholder
.Problem in #10827
While fixing problem 2, I recalled a previous bug, #10827. At that time, it was determined that #10632 caused it, so #10632 was reverted, and the issues related to #10632 were re-fixed. Fixing problem 2 is equivalent to bringing #10632 back, so bug #10827 needs to be re-investigated.
Minimal reproduction
Steps to reproduce
switchToB
buttonswitchToA
buttonWhen switching from
CompB
toCompA
, the content inCompA
disappears.afterLeave
not to perform.If the component is already mounted, inherit the transition fromwill cause [3.5.2] Transition stopped working aftercomponent.subTree
.3116553
#11829vnode.transition
duringsetTransitionHooks
tocomponent.subTree
Thanks to @hooray for providing the reproduction