angular / angular/components

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

Đang mở
#30,239 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: cdk/drag-drop P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và kiểm tra hành vi của cdkDropListSortPredicate khi một mục đi vào dropzone Done từ phía trên. Tái hiện trường hợp này trong Angular 19.0.0, sau đó xác minh rằng predicate ngăn mục được thả vào index đầu tiên trong khi vẫn giữ nguyên các hành vi sắp xếp khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.