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 moveBefore — whatwg/dom#1307. And, Chrome has begun implementing it — https://chromestatus.com/feature/5135990159835136. This should directly address the shuffle-disconnect issue.
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 adisconnectfollowed by aconnect— there’s no great way to perform this shuffle without causing at least one disconnection.A new API is being proposed called
moveBefore— whatwg/dom#1307. And, Chrome has begun implementing it — https://chromestatus.com/feature/5135990159835136. This should directly address the shuffle-disconnect issue.