fix(runtime-core): use correct container for moving Teleport content (#1703)
This commit is contained in:
@@ -139,6 +139,13 @@ export const TeleportImpl = {
|
||||
parentSuspense,
|
||||
isSVG
|
||||
)
|
||||
if (n2.patchFlag > 0 && n2.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
||||
const oldChildren = n1.children as VNode[]
|
||||
const children = n2.children as VNode[]
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
children[i].el = oldChildren[i].el
|
||||
}
|
||||
}
|
||||
} else if (!optimized) {
|
||||
patchChildren(
|
||||
n1,
|
||||
|
||||
@@ -960,7 +960,8 @@ function baseCreateRenderer(
|
||||
// which also requires the correct parent container
|
||||
!isSameVNodeType(oldVNode, newVNode) ||
|
||||
// - In the case of a component, it could contain anything.
|
||||
oldVNode.shapeFlag & ShapeFlags.COMPONENT
|
||||
oldVNode.shapeFlag & ShapeFlags.COMPONENT ||
|
||||
oldVNode.shapeFlag & ShapeFlags.TELEPORT
|
||||
? hostParentNode(oldVNode.el!)!
|
||||
: // In other cases, the parent container is not actually used so we
|
||||
// just pass the block element here to avoid a DOM parentNode call.
|
||||
|
||||
Reference in New Issue
Block a user