angular / angular/components

cdkDropList: event.previousIndex does not update on second move

Aperta
#14,056 12 commenti 7 reazioni 0 assegnatari Vedi su GitHub
area: cdk/drag-drop P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e dalla gestione degli eventi cdkDropList utilizzata con Material Table. Riproduci due spostamenti consecutivi e verifica se previousIndex riflette la posizione all'inizio del trascinamento. Il lavoro è completato quando l'ordinamento e lo spostamento continuano a funzionare correttamente negli spostamenti successivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.