bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.65k stars 1.33k forks source link

A bug occurs when deleting a box :A DOM element reference is required, But there is no problem using shift to select #2221

Open nanfb opened 3 months ago

nanfb commented 3 months ago

Describe the Bug

I don't know if this is a feature: shift+left mouse button to select the element dragged into the canvas, and then use the shortcut key del to delete, a bug will appear: console.ts:40 unhandled error in event listener Error: A DOM element reference is required, But there is no problem using shift to select

Steps to Reproduce

Shift+left mouse button selects the elements dragged into the canvas, and then uses the shortcut key del to delete shift+left mouse button to select the elements dragged into the canvas, and then uses the shortcut key del to delete

The following cases occurred in:https://demo.bpmn.io/s/start

https://github.com/user-attachments/assets/3b263e7e-f539-4618-9e6a-990f23684291

Expected Behavior

Delete the node selected by the box

Environment

barmac commented 3 months ago

I can reproduce this issue. Thanks for reporting.

nikku commented 3 months ago

@barmac I cannot reproduce it locally. Could we try to get https://github.com/bpmn-io/bpmn-io-demo/pull/184 merged and see if we can still reproduce?

barmac commented 3 months ago

I cannot reproduce the issue with the PR you shared!

barmac commented 3 months ago

I can reproduce it on main though.

https://github.com/user-attachments/assets/d94f8a15-ce74-465d-8bc2-939fc94bdf31

barmac commented 3 months ago

Note that you need to keep pressing shift when you add the second shape, and select the same shape with shift pressed again.

nanfb commented 3 months ago

@barmac我无法在本地重现它。我们可以尝试合并https://github.com/bpmn-io/bpmn-io-demo/pull/184并查看是否仍可以重现吗? Simple multi-selection is normal. The key point is box selection, which is to hold down shift and use the left mouse button to select nodes and then delete them.

barmac commented 2 months ago

@nikku to add it to the spring cleaning list.