You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After splicing an array that is rendered with {#each} block, the onDestroy has a wrong reference to the prop, this can be observed in my reproduction - after clicking on remove we are removing an element from the middle of an array and onDestroy is called with x that corresponds to the last element of the array instead (?). After going out of flushSync last element's field is now undefined because of onDestroy (or null if onDestroy is not used).
Describe the bug
After splicing an array that is rendered with
{#each}
block, theonDestroy
has a wrong reference to the prop, this can be observed in my reproduction - after clicking on remove we are removing an element from the middle of an array andonDestroy
is called withx
that corresponds to the last element of the array instead (?). After going out offlushSync
last element's field is nowundefined
because ofonDestroy
(or null ifonDestroy
is not used).Reproduction
https://svelte.dev/playground/1d048ad074c64ca586a46d3d8daecd83?version=5.20.5
Logs
We are splicing in the middle, why
onDestroy
has a reference to the last value?System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: