mirror of https://github.com/sveltejs/svelte
fix: improve consistency issues around binding invalidation (#9810)
* co * Add commentpull/9811/head
parent
01a2117330
commit
d793d570e2
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: improve consistency issues around binding invalidation
|
@ -0,0 +1,16 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ assert, target }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, 'a\n<select></select><button>change</button');
|
||||||
|
|
||||||
|
const [b1] = target.querySelectorAll('button');
|
||||||
|
b1.click();
|
||||||
|
await Promise.resolve();
|
||||||
|
|
||||||
|
assert.htmlEqual(
|
||||||
|
target.innerHTML,
|
||||||
|
'a\n<select></select>b\n<select></select><button>change</button'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
let entries = $state([{selected: 'a'}])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#each entries as entry}
|
||||||
|
{entry.selected} <select bind:value={entry.selected}></select>
|
||||||
|
{/each}
|
||||||
|
|
||||||
|
<button
|
||||||
|
on:click={
|
||||||
|
() => entries = [{selected: 'a'}, {selected: 'b'}]
|
||||||
|
}
|
||||||
|
>change</button>
|
Loading…
Reference in new issue