angular / angular/components

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

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

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par exécuter la reproduction StackBlitz liée et inspectez src/app/cdk-drag-drop-horizontal-sorting-example.css, .ts et .html. Reproduisez le glissement de « Iron age » sur l’espace vide en face de « Early modern period », puis suivez le comportement de tri horizontal de CdkDragDrop. Le travail est terminé lorsque des éléments de tailles différentes se réordonnent sans scintillement, comme dans les cas de même taille et de conteneur plus court.

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é
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

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