Drag&Drop Drop List Dynamic Preview
- 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ả
#### What are you trying to do?
I want to be able to change the drag and drop preview depending on which container you're dropping into.
In my stackblitz I have three different containers. The first and third one have regular drag and drop previews, but the second one I'd like to customize the drag and drop preview. Using
```
``` works when dragging elements from the second container, but I'd like the preview to be dynamic depending on where you're dropping it.
For example, if you grab an item from the first container and drag it over the second, I'd like the preview to be the image. But it you drag that same item over the third, it should switch back to the regular preview.
#### What troubleshooting steps have you tried?
I've tried to manually do it using cdkDragDropEntered and cdkDragDropExited events but it did not work as expected. Especially with the differences in the width of the previews.
#### Reproduction
https://stackblitz.com/edit/angular-suzb2h
#### Environment
- Angular: latest
- CDK/Material: latest
- Browser(s): All
- Operating System (e.g. Windows, macOS, Ubuntu): All
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à hành vi xem trước kéo và thả của Angular CDK. Xem lại cách cdkDragPreview, cdkDragDropEntered và cdkDragDropExited được sử dụng trong bản tái hiện, sau đó xác định xem bản xem trước sẽ thay đổi như thế nào giữa ba container. Hoàn tất khi bản xem trước chuyển đổi một cách đáng tin cậy khi đi vào và rời khỏi từng container mà không bị sai kích thướ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
- 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
- 35/100