]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-dom): fix transition children check for whitespace nodes
authorEvan You <yyx990803@gmail.com>
Tue, 21 Sep 2021 16:25:05 +0000 (12:25 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 21 Sep 2021 16:25:05 +0000 (12:25 -0400)
fix #4637

packages/compiler-dom/src/transforms/warnTransitionChildren.ts

index c4347879fadd9bc0188797c80857e436d9879ef5..4e9bdba20bc287560cd0110e9ec799965d117037 100644 (file)
@@ -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 (