Drag and Drop list ordering issue
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
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) {
console.log(event);
moveItemInArray(this.strings, event.previousIndex, event.currentIndex);
}
```
The HTML:
```
{{string}}
```
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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire le problème dans l’issue et comparez son markup avec la présentation du glisser-déposer d’Angular Material CDK. Inspectez la configuration de cdkDropList et cdkDrag, puis vérifiez previousIndex et currentIndex de l’événement de dépôt lors du déplacement entre les éléments. C’est terminé lorsque l’élément déplacé reste à sa nouvelle position et que les données de la liste sont réordonnées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 42/100