-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
Describe the bug
<script>
let array;
$: {
array = []
array[0] = [false, false];
array[1] = [false, false];
}
</script>
{#each array as row, i}
{#each row as item, j}
<button on:click={() => array[i][j] = !array[i][j]}>{item}</button>
{/each}
<br>
{/each}
(Apologies for the weird repro. I tried a couple of other things, but couldn't find anything simpler.)
In Svelte 4, clicking the buttons toggles their text. In Svelte 5, it does not. There are a couple of things that seem to be necessary for this issue to arise. One is the value being assigned inside a reactive block. (If the contents of the reactive block instead appear at the top-level of the component, this works fine.) The other is it being a two-dimensional array.
Reproduction
Logs
No response
System Info
n/a
Severity
annoyance