diff --git a/src/compile/nodes/IfBlock.ts b/src/compile/nodes/IfBlock.ts index 4852950429..2a5a49af16 100644 --- a/src/compile/nodes/IfBlock.ts +++ b/src/compile/nodes/IfBlock.ts @@ -90,6 +90,9 @@ export default class IfBlock extends Node { dynamic = true; block.addDependencies(node.else.block.dependencies); } + + if (node.else.block.hasIntros) hasIntros = true; + if (node.else.block.hasOutros) hasOutros = true; } } diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html b/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html new file mode 100644 index 0000000000..c66687863a --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html @@ -0,0 +1 @@ +
x
', + + test(assert, component, target) { + component.set({ x: 'y' }); + assert.htmlEqual(target.innerHTML, 'y
'); + }, +}; diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/main.html b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html new file mode 100644 index 0000000000..5789f2386e --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html @@ -0,0 +1,21 @@ +{#if foo} +foo
+{:else} +{x}
+ +{/if} + + \ No newline at end of file