Re: [whatwg/dom] Add convenient, ergonomic, performant API for sorting siblings (#586)

Re. not detaching nodes, agreed (as per my first comment), it was more of a suggestion for the API shape. It would also be nice to be able to move nodes diagonally (changing their parents) within the same document while preserving state. The same method could be used.

@WebReflection so you have nodes that are pinned within lists of nodes that can move? Did I get this right? I've dabbed with a finely reactive framework and also use pairs of comments, but to delineate the dynamic bits. So `parent.rearangeChildren(nodes, {previous,next})` would *almost* be a direct replacement for what the diffing logic.

The only missing piece would be delayed node removal for exit animations. The `options` object could take an `async delayRemoval(){}` callback, called once per node removed, that would wait until the promise resolution to perform the action. Pre/post-reordering hooks for list animations would also be handy, but these can live in user space.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/586#issuecomment-1425303745
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/586/1425303745@github.com>

Received on Friday, 10 February 2023 07:22:41 UTC