remove components without props from each block - fixes #3035

pull/3106/head
Richard Harris 5 years ago
parent 35001b36cc
commit 7696c1fa6e

@ -465,7 +465,7 @@ export default class EachBlockWrapper extends Wrapper {
`);
remove_old_blocks = deindent`
@group_outros();
for (; #i < ${view_length}; #i += 1) ${out}(#i);
for (#i = ${this.vars.each_block_value}.${length}; #i < ${view_length}; #i += 1) ${out}(#i);
@check_outros();
`;
} else {

@ -0,0 +1,10 @@
export default {
html: `
<p>hello</p>
`,
async test({ assert, component, target }) {
await component.remove();
assert.htmlEqual(target.innerHTML, ``);
}
};

@ -0,0 +1,13 @@
<script>
import Child from './Child.svelte';
let items = [1];
export function remove() {
items = [];
}
</script>
{#each items as item}
<Child/>
{/each}
Loading…
Cancel
Save