Shaddix/dnd-kit-sortable-tree

depth property is not working

Closed this issue · 2 comments

How can we prevent folder moving inside to another folder? but all other items are free to move around?
I tried depth property, but not showing any effect.

I've adjusted the canHaveChildren prop a little bit, maybe it will help.
You could check out an example:

canHaveChildren: (dragItem) => (dragItem.id === 2 ? false : true),

working now.
as I can check for dragItem.canHaveChildren boolean or not. thank you