File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/runtime-core/src/components Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ export interface SuspenseBoundary {
379
379
container : RendererElement
380
380
hiddenContainer : RendererElement
381
381
anchor : RendererNode | null
382
- activeBranch : VNode | null
382
+ activeBranch : ( VNode & { __isUnmounted ?: boolean } ) | null
383
383
pendingBranch : VNode | null
384
384
deps : number
385
385
pendingId : number
@@ -508,7 +508,10 @@ function createSuspenseBoundary(
508
508
// this is initial anchor on mount
509
509
let { anchor } = suspense
510
510
// unmount current active tree
511
- if ( activeBranch ) {
511
+ // #7966 if suspense is wrapped in Transition, the Transition's afterLeave may not have been
512
+ // performed (this means the fallbackVNode not mounted) when suspense resolves.
513
+ // so avoid unmount activeBranch again
514
+ if ( activeBranch && ! activeBranch . __isUnmounted ) {
512
515
// if the fallback tree was mounted, it may have been moved
513
516
// as part of a parent suspense. get the latest anchor for insertion
514
517
anchor = next ( activeBranch )
@@ -608,6 +611,8 @@ function createSuspenseBoundary(
608
611
true // shouldRemove
609
612
)
610
613
614
+ activeBranch ! . __isUnmounted = true
615
+
611
616
if ( ! delayEnter ) {
612
617
mountFallback ( )
613
618
}
You can’t perform that action at this time.
0 commit comments