angular / angular/components

cdkDropList: event.previousIndex does not update on second move

Offen
#14,056 12 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: cdk/drag-drop P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der verlinkten StackBlitz-Reproduktion und der cdkDropList-Ereignisbehandlung, die mit Material Table verwendet wird. Führe zwei aufeinanderfolgende Verschiebungen durch und prüfe, ob previousIndex die Position zu Beginn des Ziehens widerspiegelt. Erledigt ist die Aufgabe, wenn Sortieren und Verschieben bei nachfolgenden Verschiebungen weiterhin korrekt funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.