Closed dollarunderscore closed 3 years ago
moving the drawflow container with the mouse is core functionality and should work. and i have exactly the same issue in my project.
Hello @dollarunderscore
You can prevent the behavior like this:
editor.start();
document.addEventListener('mousemove', function(e) {
if(e.target.closest(".parent-drawflow") === null) {
editor.dragEnd(e);
}
});
Even I like the normal way better. You can use this method.
Thanks for the answer, the dragEnd has helped me a lot. i have optimized the code a bit so that it is only executed on the "mouseleave" event.
With jQuery (change this.drawfow to your drawflow instance):
$("#drawflow").on("mouseleave", (event) => {
this.drawflow.dragEnd(event.originalEvent);
});
If you click in the drawflow container and move the mouse outside the container and then move the mouse back into the container, the container content is moved although the mouse is not clicked anymore.
To reproduce the issue:
=> container content is moving with the mouse when not clicked