From: Evan You Date: Tue, 21 Sep 2021 16:25:05 +0000 (-0400) Subject: fix(compiler-dom): fix transition children check for whitespace nodes X-Git-Tag: v3.2.13~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed6470c845efa57d902c50a7b97e4a40331e9621;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-dom): fix transition children check for whitespace nodes fix #4637 --- diff --git a/packages/compiler-dom/src/transforms/warnTransitionChildren.ts b/packages/compiler-dom/src/transforms/warnTransitionChildren.ts index c4347879fa..4e9bdba20b 100644 --- a/packages/compiler-dom/src/transforms/warnTransitionChildren.ts +++ b/packages/compiler-dom/src/transforms/warnTransitionChildren.ts @@ -36,7 +36,9 @@ export const warnTransitionChildren: NodeTransform = (node, context) => { function hasMultipleChildren(node: ComponentNode | IfBranchNode): boolean { // #1352 filter out potential comment nodes. const children = (node.children = node.children.filter( - c => c.type !== NodeTypes.COMMENT + c => + c.type !== NodeTypes.COMMENT && + !(c.type === NodeTypes.TEXT && !c.content.trim()) )) const child = children[0] return (