angular / angular/components

bug(drag-drop): changing the disable state dynamically doesn't work

Đang mở
#19,065 10 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ả

#### Reproduction

For some reason, in Stackblitz it works: https://stackblitz.com/edit/angular-ghqzcr
But in a new project, the bug also reproduces: https://github.com/doronsever/drag-drop-bug
I copied everything from stackblitz to my project and still doesn't work.

I need the initiate state of the drag and drop to be disabled and only when clicking on the mouse down to enable it.
The reason for that is that I have also a resize option and if the drag and drop is enabled, when resizing it is also dragging the element.

So in my real app, I'm starting with the drag and drop disabled, and on a mousedown event, I check if the mouse is not touching the resize button and only then enabling the drag and drop.
Up until Angular 8, everything worked fine but now that we are trying to upgrade to Angular 9 (and also material to 9, this behavior stopped working).


#### Expected Behavior

When setting the flag to false, enable the dragging even if the mouse is down.

#### Actual Behavior

drag and drop doesn't work

#### Environment

- Angular: 9.1.1
- CDK/Material: 9.2.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Mac

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

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

Hướng nghiên cứu

Bắt đầu bằng cách so sánh bản tái hiện trên StackBlitz với bản tái hiện new-project được liên kết, tập trung vào thiết lập drag-and-drop của Angular CDK và flag disabled động. Tái hiện hành vi của Angular 9.1.1/Material 9.2.0 trong Chrome, sau đó xác minh rằng có thể bật thao tác kéo trong mousedown, trong khi thao tác thay đổi kích thước không bắt đầu ké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ó
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.