Nestable2
Nestable2 copied to clipboard
dd-nochildren not working as expected
Drag a item above dd-nochildren item just not show the placeholder, but if it have children by default and you drop it, it will become a children anyway.
Confirming the same behaviour. So this option can't be used for forbiding to drop some element into another element in all cases, as it noticed at readme:
For example you can conditionally add .dd-nochildren to forbid dropping current element to some other elements for instance based on data-type of current element and other elements
I'm trying to implement this feature in another way, by adding beforeDragStop callback which able to cancel drag&drop if callback return false.
Looks like that in case of using dd-nochildren class, we have to add some additional conditions, but what if we need to cancel drop items in a root list from child? It sounds bit illogical to have no children if we already have them, IMHO.
Here is some conversation on it: https://github.com/dbushell/Nestable/pull/143