Skip to content

Commit

Permalink
fix(runtime-core): condition for parent node check should be any diff…
Browse files Browse the repository at this point in the history
…erent nodes

fix #622
  • Loading branch information
yyx990803 committed Jan 16, 2020
1 parent 04ac6c4 commit c35fea3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!)!
Expand All @@ -613,7 +612,7 @@ export function createRenderer<
fallbackContainer
patch(
oldVNode,
newChildren[i],
newVNode,
container,
null,
parentComponent,
Expand Down

0 comments on commit c35fea3

Please sign in to comment.