Skip to content

[5.43.12] unshift breaks keyed #each index #17201

@henrykrinkle01

Description

@henrykrinkle01

Describe the bug

When using unshift to add elements to an array used in a keyed #each block, the index doesn't correctly update, breaking everything inside that depends on it (element id, input names, etc).

Reproduction

Working:
https://svelte.dev/playground/2c88b99bca074875bc50c2b9d0462545?version=5.43.11
Not working:
https://svelte.dev/playground/2c88b99bca074875bc50c2b9d0462545?version=5.43.12

Logs

System Info

svelte@5.43.12

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions