angular / angular/components

bug(drag-drop): Item not always restored to initial index when using cdkDropListSortingDisabled on connected lists

Ouverte
#26,360 3 commentaires 0 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

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

Dragging an item from its original drop list to another one then dragging it back to the original drop list isn't always restored to its initial index.

### Reproduction

StackBlitz: https://stackblitz.com/edit/angular-1ra8a1?file=src/app/cdk-drag-drop-disabled-sorting-example.html

Steps to reproduce:
1. Drag any item item from the top container to the bottom one (without dropping) and drag it back to the top container
2. Observer that the item gets re-added at its original index in the top container
3. Drag any item but the first from the bottom container to the top one (without dropping) and drag it back to the bottom container

### Expected Behavior

Item re-added to the bottom container at its original index.

### Actual Behavior

Item re-added to the bottom container at an index lower than its original.

### Environment

- Angular: 15.0.4
- CDK/Material: 15.0.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire le problème dans le StackBlitz lié, en particulier dans src/app/cdk-drag-drop-disabled-sorting-example.html, et vérifiez si l’index change lorsque des éléments sont déplacés entre des listes connectées sans être déposés. Suivez la gestion de CDK drag-drop pour le tri désactivé et confirmez que c’est terminé lorsqu’un élément revient dans sa liste d’origine à son index d’origine.

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
45/100

Recevez les nouvelles issues par e-mail

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