mirror of https://github.com/sveltejs/svelte
Merge pull request #1986 from sveltejs/gh-1985
Fix adjacent tracking across adjacent scopes - #1985pull/1988/head
commit
dfb661ec0d
@ -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