angular / angular/components

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

オープン
#30,239 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: cdk/drag-drop P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた StackBlitz の再現例から始め、アイテムが上から Done ドロップゾーンに入ったときの cdkDropListSortPredicate の動作を調査します。Angular 19.0.0 でこのケースを再現し、その後、predicate によってアイテムが最初のインデックスにドロップされるのを防ぎつつ、他のソート動作が維持されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。