kutlugsahin / ngx-smooth-dnd

angular wrapper for smooth-dnd
165 stars 30 forks source link

Ondrop is not fired when working with sub component #15

Open fatnjazzy opened 6 years ago

fatnjazzy commented 6 years ago

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>
batalla3692 commented 5 years ago

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!