angular / angular/components

bug(CdkDragDrop): reordering smaller against larger items produce flickering effect

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

Descrizione

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When using CdkDragDrop for reordering items with different sizes (e.g. width for horizontal orientation) in a container with greater height then of the elements there is a flickering effects. CdkDragDrop moves larger item really quickly from one side to another.

Try to drag "Iron age" over empty space in container against some wider item (e.g. "Early modern period")

Example uses angular 12, but in angular 17 it works the same.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/angular-fhqz1h?file=src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.css,src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.ts,src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.html

### Expected Behavior

Reorder elements without flickering effects, as it is when reordering elements of the same size or when container is not larger (e.g. greater height for horizontal list).

### Actual Behavior

Larger element in the list that is reordered against moves fast from one side to another.

### Environment

- Angular: 12
- CDK/Material: 12
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia eseguendo la riproduzione collegata di StackBlitz e ispeziona src/app/cdk-drag-drop-horizontal-sorting-example.css, .ts e .html. Riproduci il trascinamento di “Iron age” sopra lo spazio vuoto di fronte a “Early modern period”, quindi traccia il comportamento di ordinamento orizzontale di CdkDragDrop. Il lavoro è completato quando gli elementi di dimensioni diverse vengono riordinati senza sfarfallio, in modo coerente con il comportamento degli elementi della stessa dimensione e dei contenitori più corti.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.