From ed6470c845efa57d902c50a7b97e4a40331e9621 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 21 Sep 2021 12:25:05 -0400 Subject: [PATCH] fix(compiler-dom): fix transition children check for whitespace nodes fix #4637 --- .../compiler-dom/src/transforms/warnTransitionChildren.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/compiler-dom/src/transforms/warnTransitionChildren.ts b/packages/compiler-dom/src/transforms/warnTransitionChildren.ts index c4347879..4e9bdba2 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 (