minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

customise element wrapper if has children

ayoub-root opened this issue · comments

customise item wrapper by specifying where the subelement (example 2, 3) will be inserted in the green zone like illustrated in the picture
image

@ayoub-root

By default, dropping from a child to its parent is not allowed, but you can control its behavior with the canDrop callback.

Also, since the onDrop callback is passed the node information of the source and destination of the drop, it is possible to detect the drop from the child to the parent.

After detecting the drop from the child to the parent, customize the tree data based on this information. Use the customized data to control the rendering of the parent node as needed.