mirror of https://github.com/sveltejs/svelte
parent
86f326531c
commit
eedb59355f
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: adjust keyed each block equality handling
|
@ -0,0 +1,21 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `100\n<button>Update</button>`,
|
||||
|
||||
async test({ assert, target }) {
|
||||
/**
|
||||
* @type {{ click: () => void; }}
|
||||
*/
|
||||
let btn1;
|
||||
|
||||
[btn1] = target.querySelectorAll('button');
|
||||
|
||||
flushSync(() => {
|
||||
btn1.click();
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `1000\n<button>Update</button>`);
|
||||
}
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
const roomState = writable({
|
||||
users: {"gary": { name: "gary", value: 100 }},
|
||||
});
|
||||
</script>
|
||||
|
||||
{#each Object.values($roomState.users) as user (user.name)}
|
||||
{user.value}
|
||||
{/each}
|
||||
|
||||
<button onclick={() => $roomState.users["gary"].value = 1000}>Update</button>
|
Loading…
Reference in new issue