bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
22.06k stars 1.97k forks source link

Drop event not fired ionic 2. #465

Closed nchakarov777 closed 4 years ago

nchakarov777 commented 7 years ago

I've created an ionic 2 app and I'm trying to add dragula. I've installed and imported the ng2-dragula. In the app.module.ts : import { DragulaModule, DragulaService } from 'ng2-dragula/ng2-dragula'; and passed them to the imports and the providers.

In the component I have also imported the dragula service and subscribed for some of it events:

`dragulaService.drag.subscribe((value) => { console.log(value); console.log('0'); }); dragulaService.remove.subscribe((value) => { console.log(value); console.log('1'); });

dragulaService.drop.subscribe((value) => {
  console.log(value);
  console.log('2');
});

dragulaService.dropModel.subscribe((value) => {
  console.log(value);
  console.log('3');
});`

And in the template I have: <ion-content> <ion-list [dragula]="'my-bag'" [dragulaModel]="appPages" > <button ion-item menuClose *ngFor="let p of appPages" (click)="openPage(p)"> <ion-icon item-left [name]="p.icon"></ion-icon> {{p.title}} </button> <button ion-item menuClose (click)="addNew()"> Add new </button> </ion-list> </ion-content>

but when I drag any button in the list and then drop it, it doesn't change its position and in the console I've got printed only 0. Am I missing something ? I seems that the drop event is never fired.

olivier-po commented 6 years ago

Did you find a solution to it ? The drop event doesn't fire for me either, only the drag event.

Helison commented 6 years ago

@nikichak end @olivier-po Did you find a solution to it ?