File tree 2 files changed +11
-4
lines changed
packages/runtime-core/src
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export interface TeleportProps {
20
20
21
21
export const isTeleport = ( type : any ) : boolean => type . __isTeleport
22
22
23
- const isTeleportDisabled = ( props : VNode [ 'props' ] ) : boolean =>
23
+ export const isTeleportDisabled = ( props : VNode [ 'props' ] ) : boolean =>
24
24
props && ( props . disabled || props . disabled === '' )
25
25
26
26
const resolveTarget = < T = RendererElement > (
Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ import {
56
56
queueEffectWithSuspense ,
57
57
SuspenseImpl
58
58
} from './components/Suspense'
59
- import { TeleportImpl , TeleportVNode } from './components/Teleport'
59
+ import {
60
+ isTeleportDisabled ,
61
+ TeleportImpl ,
62
+ TeleportVNode
63
+ } from './components/Teleport'
60
64
import { isKeepAlive , KeepAliveContext } from './components/KeepAlive'
61
65
import { registerHMR , unregisterHMR , isHmrUpdating } from './hmr'
62
66
import {
@@ -2037,8 +2041,11 @@ function baseCreateRenderer(
2037
2041
unmountChildren ( children as VNode [ ] , parentComponent , parentSuspense )
2038
2042
}
2039
2043
2040
- // an unmounted teleport should always remove its children
2041
- if ( shapeFlag & ShapeFlags . TELEPORT ) {
2044
+ // an unmounted teleport should always remove its children if not disabled
2045
+ if (
2046
+ shapeFlag & ShapeFlags . TELEPORT &&
2047
+ ( doRemove || ! isTeleportDisabled ( vnode . props ) )
2048
+ ) {
2042
2049
; ( vnode . type as typeof TeleportImpl ) . remove ( vnode , internals )
2043
2050
}
2044
2051
You can’t perform that action at this time.
0 commit comments