diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts
index cae0aa7352..bb726982df 100644
--- a/src/compile/nodes/EachBlock.ts
+++ b/src/compile/nodes/EachBlock.ts
@@ -480,6 +480,7 @@ export default class EachBlock extends Node {
if (outroBlock && this.compiler.options.nestedTransitions) {
const countdown = block.getUniqueName('countdown');
block.builders.outro.addBlock(deindent`
+ ${iterations} = ${iterations}.filter(Boolean);
const ${countdown} = @callAfter(#outrocallback, ${iterations}.length);
for (let #i = 0; #i < ${iterations}.length; #i += 1) ${outroBlock}(#i, 0, ${countdown});`
);
diff --git a/test/runtime/samples/transition-js-each-block-outro/_config.js b/test/runtime/samples/transition-js-each-block-outro/_config.js
index 5e8b99d88d..0ce6573082 100644
--- a/test/runtime/samples/transition-js-each-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-outro/_config.js
@@ -12,5 +12,8 @@ export default {
assert.equal( divs[0].foo, undefined );
assert.equal( divs[1].foo, 0.5 );
assert.equal( divs[2].foo, 0.5 );
+
+ raf.tick( 100 );
+ assert.htmlEqual(target.innerHTML, '
a
');
}
};
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-nested-each-delete/_config.js b/test/runtime/samples/transition-js-nested-each-delete/_config.js
new file mode 100644
index 0000000000..870f90efc4
--- /dev/null
+++ b/test/runtime/samples/transition-js-nested-each-delete/_config.js
@@ -0,0 +1,29 @@
+export default {
+ nestedTransitions: true,
+ skipIntroByDefault: true,
+
+ data: {
+ visible: true,
+ things: [ 'a', 'b', 'c' ]
+ },
+
+ test ( assert, component, target, window, raf ) {
+ assert.htmlEqual(target.innerHTML, `
+ a
+ b
+ c
+ `);
+
+ component.set({ things: [ 'a' ] });
+
+ raf.tick( 100 );
+ assert.htmlEqual(target.innerHTML, `
+ a
+ `);
+
+ component.set({ visible: false });
+
+ raf.tick( 200 );
+ assert.htmlEqual(target.innerHTML, '');
+ }
+};
diff --git a/test/runtime/samples/transition-js-nested-each-delete/main.html b/test/runtime/samples/transition-js-nested-each-delete/main.html
new file mode 100644
index 0000000000..e12370703e
--- /dev/null
+++ b/test/runtime/samples/transition-js-nested-each-delete/main.html
@@ -0,0 +1,20 @@
+{#if visible}
+ {#each things as thing}
+ {thing}
+ {/each}
+{/if}
+
+