react-nestable icon indicating copy to clipboard operation
react-nestable copied to clipboard

Confirm after dropped Item and before rendering

Open tabunan opened this issue 4 years ago • 0 comments

Hello,

Nice package.

Im currently working on a set of groups items. A parent can't drag and set as a child then a child can't drag or set as a parent. So far I can do this using confirmChange the only problem is that if the parent does not have a child you can't drop to item. confirmChange = ({dragItem, destinationParent}) => {

 if( dragItem.parent == 0 && destinationParent) { return false }

 if( dragItem.parent != 0 && !destinationParent ) { return false}

return true;

} ` I hope it makes sense :)

tabunan avatar Sep 10 '21 04:09 tabunan