From bef207dc8f38f35d2524651b9824750d2e10443f Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 21 Sep 2021 15:44:46 -0700 Subject: [PATCH] fix: fix transition-group processing of whitespace nodes fixes #4621, #4622 --- packages/runtime-core/src/components/BaseTransition.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/components/BaseTransition.ts b/packages/runtime-core/src/components/BaseTransition.ts index cb628bf655a..009392bd572 100644 --- a/packages/runtime-core/src/components/BaseTransition.ts +++ b/packages/runtime-core/src/components/BaseTransition.ts @@ -8,6 +8,7 @@ import { cloneVNode, Comment, isSameVNodeType, + Text, VNode, VNodeArrayChildren, Fragment @@ -470,7 +471,8 @@ export function getTransitionRawChildren( ) } // comment placeholders should be skipped, e.g. v-if - else if (keepComment || child.type !== Comment) { + // #4621, #4622, #4637 also skip text nodes + else if ((keepComment || child.type !== Comment) && child.type !== Text) { ret.push(child) } }