I created spreadsheet with Svelte, but it seems like it won't update the cell properly.
I appended the "2" postfix to every cell, and when I edit the content (say to fix first letter in jim to be uppercased) it should end up with two "2" as "Jim22". But it end up with just one "2" as "Jim2".
I also have JSON output to inspect the value of rows, and it changed, so the component was updated correctly, but the editable cell was not updated to "Jim22" it still "Jim2".
Why, and how to fix that?
Code
<script>
let rows = [
["jim"],
["Kate"]
]
function update(i, j, event) {
rows[i][j] = event.target.innerText
}
</script>
<table>
{#each rows as row, i}
<tr>
{#each row as cell, j}
<td contenteditable="true" on:blur="{(event) => update(i, j, event)}">{cell}2</td>
{/each}
</tr>
{/each}
</table>
<pre>{JSON.stringify(rows, null, 2)}</pre>
