ngx-smooth-dnd
ngx-smooth-dnd copied to clipboard
Ondrop is not fired when working with sub component
Hi.
When using a sub component that is wrapping smooth-dnd-draggable
the drop event is not triggered.
But, if you put smooth-dnd-draggable
directly under smooth-dnd-container
it is working.
So, the bellow app-draggable
will not trigger the onDrop inside id.
Is this as designed? Thanks
<smooth-dnd-container [groupName]='1' (dragStart)="log('drag start', $event)" [orientation]="'horizontal'" (drop)="onDrop($event,'1')">
<smooth-dnd-draggable><div id="sadf">THIS IS WORKING</div></smooth-dnd-draggable>
<app-draggable >THIS WILL NOT WORK</app-draggable>
</smooth-dnd-container>
I found the very same problem. When I wrap smooth-dnd-draggable
content inside a component, some of the properties of smooth-dnd-container
doesn't work. In my case, [dragClass]
, [dropClass]
, (dragStart)
and (dragEnd)
are the properties that doesn't work with component wrapping. I don't test all the properties, but at least (drop)
and [lockAxis]
work as expected.
If I put smooth-dnd-draggable
content on the same component that smooth-dnd-container
, every property work as a charm.
PS: You've done an amazing job, thank you and congrats!