angular / angular/components

cdkDropList: event.previousIndex does not update on second move

Ouverte
#14,056 12 commentaires 7 réactions 0 personnes assignées Voir sur GitHub
area: cdk/drag-drop P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Bug, feature request, or proposal:
When you drag and drop a row for the second time, the previousIndex is still the same as the initial value.

#### What is the expected behavior?
previousIndex should reflect the items position when the dragging is started.

#### What is the current behavior?
It stays the same as the initial value, so neither sorting nor moving works as intended. It only works the first time moving the row, after that it will always jump back/move another item.

#### What are the steps to reproduce?
Stackblitz here:
https://stackblitz.com/edit/table-drag-n-drop

#### Is there anything else we should know?
I am using cdkDropList together with Material Table.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et la gestion des événements cdkDropList utilisée avec Material Table. Reproduisez deux déplacements successifs et vérifiez si previousIndex reflète la position au début du glissement. Le travail est terminé lorsque le tri et le déplacement continuent de fonctionner correctement lors des déplacements suivants.

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é
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.