Skip to content

Keyed each block is updated unnecessarily #4373

@Rich-Harris

Description

@Rich-Harris

Describe the bug
In this app, via this SO question, a keyed each block is updated when any variable is reassigned, rather than only when the dependencies of the block are.

The update_keyed_each(...) call isn't being wrapped in an if (dirty & ...) block, as it should.

To Reproduce
https://svelte.dev/repl/191e46b4229043a89ac5018658a84ecb?version=3.18.1

Expected behavior
Adding items via the input shouldn't have any effect, because the array is being mutated but not reassigned.

Severity
Low

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions