akserg / ng2-dnd

Angular 2 Drag-and-Drop without dependencies
MIT License
840 stars 251 forks source link

dragData issue #210

Open TomMettam opened 6 years ago

TomMettam commented 6 years ago

If an dnd-draggable component is also defined as a dnd-droppable, or the dnd-draggable component is a child of the dnd-droppable, dragData is never set.

This appears to occur because the this._dragEnabled is FALSE inside _onDragStart in the abstract component.

dnd-droppable (onDropSuccess)="itemDropped($event)" dnd-draggable [dragEnabled]="true" [dragData]="dragData"

Hainesy commented 6 years ago

I'm also experiencing this issue. Draggables need to also be droppables when, for example, wanting to reorder table columns.

chopsticks777 commented 6 years ago

Any news? I have created even a new Angular 5 project from scratch and noticed that dragData isn't set at all...


<div dnd-draggable (onDragEnd)="onDragEnd($event)" [dragData]="dragData">
    <div style="width: 150px; height:150px; border:solid;"></div>
</div>
TomMettam commented 6 years ago

I ended up switching to angular4-drag-drop (https://bitbucket.org/IpponMattRitter/angular4-drag-drop)