Skip to content

Order is wrong for keyed each block with outros #543

Closed
@Rich-Harris

Description

@Rich-Harris

No REPL demo until #525 is released, but if you have a situation like this...

{{#each things as thing @name}}
  <div out:fade>{{thing.name}}</div>
{{/each}}

...then when you remove an item from the middle of things, the corresponding DOM node jumps to the top of the list. That's because Svelte mounts all iterations that correspond to the current value of things, in order, to whatever the anchor node is — it doesn't mount outroing nodes, with the effect being that everything preserved or created appears below everything outroing.

There isn't really a neat solution to this — instead we'll need to implement #373.

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