bpmn-io / diagram-js

A toolbox for displaying and modifying diagrams on the web.
MIT License
1.65k stars 418 forks source link

Editor throws error when enabling dragging while a tool is active #881

Closed sentry-io[bot] closed 3 months ago

sentry-io[bot] commented 3 months ago

See comment, wrong issue linked initially

Steps to Reproduce:

Root Cause: This behavior causes a mismatch between Dragging state Active state in the tool manager. When we try to start a connection through clicking, dragging is initiated. Because we cancel the event (https://github.com/bpmn-io/diagram-js/blob/0ec9a1391e9c1f7ace7ad317fe3943a97dabdacc/lib/features/tool-manager/ToolManager.js#L87-L88) while we are initiating the drag operation, it breaks when we access the context immediately after.

Proposed Fix: It is not clear why we cancel dragging in this place. This should be handled either by dragging or a higher component, such as global-connect. This is already the case. No tests break in diagram-js and bpmn-js by just removing this logic, and with my tests, everything still works as expected.

sentry-io[bot] commented 3 months ago

Sentry Issue: BPMN-IO-DEMO-1GX