bug(drag-drop): cdkDropListSortPredicate doesn't work if dragging item enter from top
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 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

### 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
Contributor guide
Research direction
Start with the linked StackBlitz reproduction and inspect the cdkDropListSortPredicate behavior when an item enters the Done dropzone from the top. Reproduce the case in Angular 19.0.0, then verify that the predicate prevents the item from being dropped at the first index while preserving other sorting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100