angular / angular/components

bug(drag-drop): cdkDropListSortPredicate doesn't work if dragging item enter from top

Ouverte
#30,239 3 commentaires 1 réaction 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

`cdkDropListSortPredicate` doesn't work in certain senarios

### Reproduction

StackBlitz link: https://stackblitz.com/edit/z6ffpx7e-wg8uidxw?file=src%2Fexample%2Fcdk-drag-drop-connected-sorting-group-example.html
Steps to reproduce:
1. Open StackBlitz reproduction link
2. The code has `cdkDropListSortPredicate` applied to "Done" dropzone, the intention is preventing item being dragged to the first index
3. Drag item from "To do" zone and enter "Done" zone from top

![Image](https://github.com/user-attachments/assets/637185b0-c963-4314-ac5b-6fd9d58d2aa8)

### Expected Behavior

Item cannot be dragged & dropped to the first index in "Done"

### Actual Behavior

Item can be dragged & dropped to the first index in "Done"

### Environment

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et examinez le comportement de cdkDropListSortPredicate lorsqu’un élément entre dans la dropzone Done par le haut. Reproduisez le cas dans Angular 19.0.0, puis vérifiez que le predicate empêche l’élément d’être déposé au premier index tout en préservant le reste du comportement de tri.

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

Recevez les nouvelles issues par e-mail

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