Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
theengineear opened this issue Feb 18, 2025 · 1 comment

Comments

@theengineear
Copy link
Collaborator

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.

@theengineear
Copy link
Collaborator Author

Note — we should look into adding a stub for connectedMoveCallback in the XElement base class once this all lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant