jgraph / mxgraph

mxGraph is a fully client side JavaScript diagramming library
Other
6.82k stars 2.06k forks source link

Graph element sticking to mouse movement after click out of window #431

Closed fortooon closed 4 years ago

fortooon commented 4 years ago

Hello, We found wrong behavior of moving elements (e.g. vertex) after some bad scenario :

  1. press left mouse button on some element (e.g. subprocess block) & move cursor out of window bounds
  2. click right mouse button (mousedown -> mouseup) while left mouse button is pressed still, then release left mouse button
  3. come back to graph & now hidden subprocess block is sticking to mouse movements, while we not click on graph.

can be reproduced on https://jgraph.github.io/mxgraph/javascript/examples/editors/workfloweditor.html For easy reproducing remove from app.js (https://jgraph.github.io/mxgraph/javascript/examples/editors/js/app.js) this code :

editor.graph.allowAutoPanning = true;
editor.graph.timerAutoScroll = true;

After some research I found that browser doesn't fire mouse up events even on direct window.document listeners after moved out of window. So probably this is not mxgraph error, but can you help me with any workaround in such case? How can I reset moving or do any trick to reset editing of graph. In our application this situation can lead to different level errors, so if possible I want to avoid such cases. I found very similar case in #131 but that solution didn't work in my case.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.