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 @@ +
A wild component appears
\ No newline at end of file diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js new file mode 100644 index 0000000000..1e8ec0a9fa --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js @@ -0,0 +1,10 @@ +export default { + nestedTransitions: true, + + html: '
A wild component appears

x

', + + test(assert, component, target) { + component.set({ x: 'y' }); + assert.htmlEqual(target.innerHTML, '
A wild component appears

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