Skip to content

Commit c35fea3

Browse files
committed
fix(runtime-core): condition for parent node check should be any different nodes
fix #622
1 parent 04ac6c4 commit c35fea3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/runtime-core/src/renderer.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,9 @@ export function createRenderer<
601601
// - In the case of a Fragment, we need to provide the actual parent
602602
// of the Fragment itself so it can move its children.
603603
oldVNode.type === Fragment ||
604-
// - In the case of Comment nodes, this is likely a v-if toggle, which
605-
// also needs the correct parent container.
606-
oldVNode.type === Comment ||
607-
newVNode.type === Comment ||
604+
// - In the case of different nodes, there is going to be a replacement
605+
// which also requires the correct parent container
606+
!isSameVNodeType(oldVNode, newVNode) ||
608607
// - In the case of a component, it could contain anything.
609608
oldVNode.shapeFlag & ShapeFlags.COMPONENT
610609
? hostParentNode(oldVNode.el!)!
@@ -613,7 +612,7 @@ export function createRenderer<
613612
fallbackContainer
614613
patch(
615614
oldVNode,
616-
newChildren[i],
615+
newVNode,
617616
container,
618617
null,
619618
parentComponent,

0 commit comments

Comments
 (0)