Intercepting Drag&Drop event

Đang mở
#1,051 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu bằng cách xem xét tích hợp kéo và thả của Angular 17, instance dragula được expose và sự kiện addComponent được mô tả trong issue. Xác định nơi có thể phát hiện thao tác drop từ panel này sang panel khác và cơ chế hủy hoặc hoàn tác được hỗ trợ nào đang tồn tại. Hoàn thành khi các thao tác drop vào panel lồng nhau bị từ chối mà không thêm component.

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

Mô tả

question

Currently working on formio with angular 17. What I'm trying to achieve is that, make sure that I have some sort of a drag-drop validation.

For example; If a user happen to start dragging, lets stay, a 'Panel' component and drop it into another 'Panel' component, I would like to intercept it and not allow to user to do that action.
As far as I conclude that, formio is using dragula for managing drag and drop futures.

I have the following HTML side:
image

Options is currently empty and default.

On top of this, I went through the event object and manage to find dragula.
image

And the dragula instance is as follows;
image

First question is, is it possible to intercept and intervene the behavior of drag and drop in such way ? If yes, how may I achieve this goal.

Example:
Following screenshot has 2 panel components. As the 2nd panel component dropped in the first component, I would like to get the event(addComponent) and check if the parent component is a panel component as well, if yes, I would like to prevent the user to perform this addComponent event and revert it.

image

Any help would be appreciated, thank you in advance.

Ngôn ngữ chính
TypeScript
Star
706
Fork
493
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của formio/angular

Tất cả issue của formio/angular

Issue tương tự

Thêm issue về TypeScript

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.