mirror of https://github.com/sveltejs/svelte
Unkeyed each blocks end up with trailing `null` values that prevent the whole from being outroed. This fixes it so the null values are removed before outroing the remaining blocks. Fixes #1617pull/1693/head
parent
0f171a5f3e
commit
4c2b9603a1
@ -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, `
|
||||
<div>a</div>
|
||||
<div>b</div>
|
||||
<div>c</div>
|
||||
`);
|
||||
|
||||
component.set({ things: [ 'a' ] });
|
||||
|
||||
raf.tick( 100 );
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div>a</div>
|
||||
`);
|
||||
|
||||
component.set({ visible: false });
|
||||
|
||||
raf.tick( 200 );
|
||||
assert.htmlEqual(target.innerHTML, '');
|
||||
}
|
||||
};
|
@ -0,0 +1,20 @@
|
||||
{#if visible}
|
||||
{#each things as thing}
|
||||
<div transition:foo>{thing}</div>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
transitions: {
|
||||
foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: t => {
|
||||
node.foo = t;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue