-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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(runtime-dom): fix anchor
loss caused by unmount
#9134
Conversation
Size ReportBundles
Usages
|
If we obtain the |
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.
Please add a unit test
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.
LGTM
Testing this locally after coming across #8105 and the fix doesn't seem to work in my case. I'm still getting an error: My app: <script setup>
import { useFrameStore } from '../stores/frame.js'
const store = useFrameStore()
// store.frameTransition is either 'slide-up' or 'slide-down'
</script>
<template>
<div>
<Transition :name="store.frameTransition" mode="out-in" appear>
<KeepAlive>
<Suspense>
<component :is="store.frame"></component>
<template #fallback>
<p>Loading...</p>
</template>
</Suspense>
</KeepAlive>
</Transition>
</div>
</template>
<style lang="stylus">
.slide-up-enter-active,
.slide-up-leave-active,
.slide-down-enter-active,
.slide-down-leave-active {
transition-property: opacity, transform;
transition-duration: .25s;
transition-timing-function: cubic-bezier(.7, 0, .265, 1);
}
.slide-up-enter-from,
.slide-up-leave-to,
.slide-down-enter-from,
.slide-down-leave-to {
opacity: 0;
}
.slide-up-enter-from,
.slide-down-leave-to {
transform: translateY(5%);
}
.slide-up-leave-to,
.slide-down-enter-from {
transform: translateY(-5%);
}
</style> |
@coreyworrell Can you put the use case into the Playground to help me better troubleshoot the issue? |
@Alfred-Skyblue nevermind, I think my issue was resolved by adding a |
This PR seems not the proper fix.
|
The error is not present but the behaviour is incorrect: You can see that the Component does not change from |
In issue #8105, there is an error behavior where an error occurs when the target node has only one child node. From the perspective of animation behavior, it seems to be waiting for the completion of the nextTick execution to switch, rather than waiting for the animation to complete. I'm not sure if this behavior is expected. |
to which vue version we should rollback to to fix this issue ? |
when this will get merged? It's making nuxt unusable |
@TomasSestak can you confirm if the issue is still present on 3.3.10, my playground example seems to be working as expected with this fix #9309 |
I'm not sure if I need to close this PR, but in some cases, acquiring the anchor may, for some reason, lead to its removal, causing a failure in |
CodSpeed Performance ReportMerging #9134 will not alter performanceComparing Summary
|
fixed #9071
fixed #8105
core/packages/runtime-core/src/renderer.ts
Line 375 in e33d554
Before executing 'unmount,' the 'anchor' was obtained. After 'unmount' completes, it is possible that the 'anchor' has been removed, causing an error when trying to find the 'anchor' during a subsequent 'mount.' This scenario only occurs when the 'anchor' is the last node. Therefore, using 'parent.appendChild(child)' for mounting is recommended.