From: Evan You Date: Thu, 16 Jan 2020 21:21:37 +0000 (-0500) Subject: fix(runtime-core): condition for parent node check should be any different nodes X-Git-Tag: v3.0.0-alpha.3~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c35fea3d608acbb571ace6693284061e1cadf7ba;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): condition for parent node check should be any different nodes fix #622 --- diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 99c0ac0867..8d79dfb786 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -601,10 +601,9 @@ export function createRenderer< // - In the case of a Fragment, we need to provide the actual parent // of the Fragment itself so it can move its children. oldVNode.type === Fragment || - // - In the case of Comment nodes, this is likely a v-if toggle, which - // also needs the correct parent container. - oldVNode.type === Comment || - newVNode.type === Comment || + // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. oldVNode.shapeFlag & ShapeFlags.COMPONENT ? hostParentNode(oldVNode.el!)! @@ -613,7 +612,7 @@ export function createRenderer< fallbackContainer patch( oldVNode, - newChildren[i], + newVNode, container, null, parentComponent,