bug(drag-drop): cdkDropListSortingDisabled interacts badly with connected lists
- 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ả
#### Reproduction
This is a fork of the "disable sorting" example from the docs.
https://stackblitz.com/edit/angular-lcgpvd?file=src/app/cdk-drag-drop-disabled-sorting-example.ts
Steps to reproduce:
1. Open example
2. Drag an item from one list to another
#### Expected Behavior
One of the following, internally-consistent behaviors:
* the receiving list provides some way of determining where the incoming item will be sorted
* the incoming item always goes before the first item
* the incoming item always goes after the last item
#### Actual Behavior
The incoming item gets a placeholder wherever the user drags it, but then can't be moved. The user can continue dragging back to the original list, so the placeholder goes back to the original position then drag over the target list again to put the placeholder in a new position -- but again, can't move the placeholder directly.
#### Environment
- Angular: 12.2.9
- CDK/Material: 12.2.9
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Win10
#### Comments
I'd like to see the first behavior implemented -- let me supply a sort-function that gets the dragged item's `data` (and maybe the index in its current container?) as an input and outputs the list index at which the placeholder should be inserted. Failing that, I'd at least like a property that lets me say that, since sorting is disabled, the placeholder should go at the "start" or "end".
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với ví dụ StackBlitz được liên kết tại src/app/cdk-drag-drop-disabled-sorting-example.ts và tái hiện thao tác kéo giữa các danh sách được kết nối khi tính năng sắp xếp bị vô hiệu hóa. Sau đó, theo dõi hành vi của CDK drag-drop đối với các danh sách được kết nối, nơi đặt placeholder. Hoàn thành khi chọn và triển khai một hành vi nhất quán cho danh sách nhận, kèm theo coverage cho reproduction đã được báo cáo.
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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
- 30/100