Nestable2 icon indicating copy to clipboard operation
Nestable2 copied to clipboard

dd-nochildren not working as expected

Open AzrielOmega opened this issue 8 years ago • 3 comments

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.

AzrielOmega avatar Feb 02 '17 16:02 AzrielOmega

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

RomanBurunkov avatar Jun 25 '17 15:06 RomanBurunkov

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.

RomanBurunkov avatar Jun 26 '17 05:06 RomanBurunkov

Here is some conversation on it: https://github.com/dbushell/Nestable/pull/143

RomanBurunkov avatar Jun 26 '17 06:06 RomanBurunkov