Skip to content

Option to update elements by key (ELM's Html.Keyed). #354

Closed
@akhilman

Description

@akhilman

As I can see from src/virtual_dom/patch.rs, the seed's virtual DOM module patches the elements in order. This means that I cannot insert an element at the top of the list of elements without updating the rest of the elements. The problem will be visible if CSS animation is applied.

ELM and Hybrids provide a special key attribute for each item to find matching new and old items.

https://guide.elm-lang.org/optimization/keyed.html
https://hybrids.js.org/template-engine/iteration#keys

Metadata

Metadata

Assignees

No one assigned

    Labels

    API designProposal for a new or updated Seed API.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions