I have a list where it should be possible to change the order of the entries (text) using drag and drop (ion-reorder). Unfortunately it does not work or at least nothing happens. I don’t get any error messages and compilation works without any problems.
liste.page.html
</div>
<ion-list>
<ion-reorder-group (ionItemReorder)="reorderItems($event)">
<ion-item-sliding *ngFor="let item of TodoListe; let i = index" [id]="'item-' + i">
<ion-item>
<ion-label>{{item}}</ion-label>
<ion-reorder slot="end"></ion-reorder>
</ion-item>
<ion-item-options side="end">
liste.page.ts
…
reorderItems(ev: any) {
const element = this.TodoListe[ev.detail.from];
this.TodoListe.splice(ev.detail.from, 1);
this.TodoListe.splice(ev.detail.to, 0, element);
ev.detail.complete();
}
…
liste.page.scss
…
.my-list-item.ion-reorder {
background-color: #e0e0e0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
…
What am I missing here? Who can help me with this or suggest what is going wrong?