Skip to content

Neither connectedCallback nor disconnectedCallback should be called when re-mapping causes a shuffle. #254

@theengineear

Description

@theengineear

Conceptually, if you render [foo, bar] and then re-render [bar, foo], neither of those elements should be disconnected at all. However, because low-level DOM apis will cause a disconnect followed by a connect — there’s no great way to perform this shuffle without causing at least one disconnection.

A new API is being proposed called moveBeforewhatwg/dom#1307. And, Chrome has begun implementing it — https://chromestatus.com/feature/5135990159835136. This should directly address the shuffle-disconnect issue.

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