react-nestable
react-nestable copied to clipboard
Confirm after dropped Item and before rendering
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 :)