diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 7054862df..89e2d980c 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -224,6 +224,7 @@ RED.view = (function() { .on("mousedown", canvasMouseDown) .on("mouseup", canvasMouseUp) .on("mouseenter", function() { + d3.select(document).on('mouseup.red-ui-workspace-tracker', null) if (lasso) { if (d3.event.buttons !== 1) { lasso.remove(); @@ -239,6 +240,7 @@ RED.view = (function() { } } }) + .on("mouseleave", canvasMouseLeave) .on("touchend", function() { d3.event.preventDefault(); clearTimeout(touchStartTime); @@ -1744,7 +1746,14 @@ RED.view = (function() { redraw(); } } - + function canvasMouseLeave() { + if (mouse_mode !== 0 && d3.event.buttons !== 0) { + d3.select(document).on('mouseup.red-ui-workspace-tracker', function() { + d3.select(document).on('mouseup.red-ui-workspace-tracker', null) + canvasMouseUp.call(this) + }) + } + } function canvasMouseUp() { lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor]; if (RED.view.DEBUG) {