mirror of https://github.com/sveltejs/svelte
fix: ensure proxied array length is updated (#9782)
* fix: ensure proxied array length is updated * fix: ensure proxied array length is updated * add test * lintpull/9791/head
parent
10aacfa603
commit
f1954d034b
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure proxied array length is updated
|
@ -0,0 +1,9 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
skip_if_ssr: 'permanent',
|
||||
html: `
|
||||
<input><input><input><div>3</div>
|
||||
`
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
let values = $state(['foo', 'bar', 'baz']);
|
||||
let elements = $state([]);
|
||||
let nums = $state([1,2,3]);
|
||||
</script>
|
||||
|
||||
{#each values as value, i}
|
||||
<input bind:this={elements[i]} bind:value={values[i]} />
|
||||
{/each}
|
||||
<div>{elements.length}</div>
|
Loading…
Reference in new issue