mirror of https://github.com/sveltejs/svelte
propagate mutation change tracking upward through deps so that adjacent scopes generate proper update code - fixes #1985
parent
a8f905f933
commit
df7c449bd3
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
async test({ assert, component, target }) {
|
||||||
|
assert.htmlEqual(component.div.innerHTML, '<div>+</div><div>-</div>');
|
||||||
|
|
||||||
|
const event = new window.Event('change');
|
||||||
|
const input = target.querySelector('input');
|
||||||
|
input.checked = false;
|
||||||
|
await input.dispatchEvent(event);
|
||||||
|
|
||||||
|
assert.htmlEqual(component.div.innerHTML, '<div>-</div><div>-</div>');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
{#each things as thing}
|
||||||
|
<div>
|
||||||
|
<input type=checkbox bind:checked={thing.ok} />
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
|
||||||
|
<div bind:this={div}>
|
||||||
|
{#each things as other}
|
||||||
|
<div>
|
||||||
|
{other.ok ? '+' : '-'}
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const things = [{ ok: true }, { ok: false }];
|
||||||
|
export let div;
|
||||||
|
</script>
|
Loading…
Reference in new issue