angular-drag-and-drop-lists icon indicating copy to clipboard operation
angular-drag-and-drop-lists copied to clipboard

How do I detect if item is being dropped into a container?

Open spreston077 opened this issue 8 years ago • 3 comments

Hello,

I have created a call back function which is called by "dnd-drop" attribute.

In this function, I have access to "index". However, I can't see any way of checking if this index is within a container or a root index in the list?

Am I missing something?

kind regards, Sean

spreston077 avatar Jan 29 '17 20:01 spreston077

Any new ideas?

Best regards, Joe

sighdok avatar Feb 03 '17 10:02 sighdok

I would like to know also...

regards, Rob

smithscripts avatar Apr 03 '17 16:04 smithscripts

in your dnd-drop callback, you can get the event. Inside this event is the path - if your structure is fixed then you can easily check if it's nested inside a container or not (for example, anything dropped into a container returned true for event.path[4].nodeName === "LI"

nateeo avatar Feb 22 '18 00:02 nateeo