ngx-smooth-dnd icon indicating copy to clipboard operation
ngx-smooth-dnd copied to clipboard

Ondrop is not fired when working with sub component

Open fatnjazzy opened this issue 6 years ago • 1 comments

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>

fatnjazzy avatar Jul 30 '18 04:07 fatnjazzy

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!

batalla3692 avatar Nov 21 '18 02:11 batalla3692