Drag Drop: disable shifting on target droplist and enable replacing
- 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ả
#### Feature Description
Looking at multiple droplists enable to drag one item from droplist 1 to droplist 2. After dropping item 1 on item 2, switch position instead of shifting all items to the next position.
#### Use Case
What we now did is just added this to every droplist:
` (cdkDropListDropped)="drop($event, indexRow)"`
In this 'drop' function we made 2 situations, either `transferArrayItem()` or `moveItemInArray()`
This just moves the items inside the droplist or moves them from one droplist to another. This all works. The downside is though, while you are dragging an item from droplist 1 to droplist 2, you see all the items in droplist 2 shifting a position to the right (When horizontal orientated). While our code says in the background to just switch places.
After the code is done, the shifted items all go back to their original places.
Hướng dẫn đóng góp
Hướng nghiên cứu
Issue không đề cập đến file hoặc test nào. Hãy bắt đầu bằng cách theo dõi hành vi danh sách kéo-thả của Angular CDK và callback cdkDropListDropped được mô tả ở đây; hoàn thành khi thao tác thả giữa các danh sách thay thế rõ ràng item đích mà không làm dịch chuyển các item lân cận.
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
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 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
- 45/100