How to move a node with children in a multi-level TreeData to a different p

TreeData has a method to move nodes from one place to another, but only if the nodes have the same parent - moveAfterSibling(T item, T sibling)

How can one move nodes (e.g. moveAfterCousin()) when the parents are different?

The TreeGrid Drag and Drop example given in [https://vaadin.com/components/vaadin-grid/java-examples/drag-and-drop]
uses remove and add item, however in a multi-level tree where the nodes to moved have children, this does not work.

Hi,

however in a multi-level tree where the nodes to moved have children, this does not work

True, looks like removing and adding back an item with children does indeed clear its hierarchy in the TreeData. The data structure should have APIs for operations such as this. Please report at https://github.com/vaadin/flow/issues

Thanks for confirming Tomi. I opened issue: [https://github.com/vaadin/flow/issues/8820]
(https://github.com/vaadin/flow/issues/8820)