Skip to content

Commit

Permalink
fix(compiler-dom): fix transition children check for whitespace nodes
Browse files Browse the repository at this point in the history
fix #4637
  • Loading branch information
yyx990803 committed Sep 21, 2021
1 parent d23fde3 commit ed6470c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit ed6470c

Please sign in to comment.