-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/drag-drop
Description
What is the expected behavior?
I am trying to reproduce the simple drag and drop list ordering example from here: https://material.angular.io/cdk/drag-drop/overview
What is the current behavior?
However, the dragged item always snaps back to its original place. The ordering animation is showing. The event shows that the previous and the current index are always 0.
https://i.imgur.com/1RkV6MT.gifv
https://i.imgur.com/k4wMbt3.gifv
What are the steps to reproduce?
The drop listener and the test data:
strings = ["dsfs","fgjdf","ghama","jéép"];
drop(event: CdkDragDrop<String[]>) {
console.log(event);
moveItemInArray(this.strings, event.previousIndex, event.currentIndex);
}
The HTML:
<div cdkDropList *ngFor="let string of strings" [cdkDropListData]="strings" (cdkDropListDropped)="drop($event)">
<mat-card cdkDrag [cdkDragData]="string">{{string}}</mat-card>
</div>
The CSS is copy-paste from the tutorial
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: 6.2.1
Material: 7.2.1
OS: Ubuntu 16.04
TypeScript: 3.2.2
Chrome: 65.0.3325.146
teuf22, pewinski, i-magera, lucas-smcaetano and Gofireng
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/drag-drop