From fac79fd0689d946e8b4d8b455a68b8c83987eeae Mon Sep 17 00:00:00 2001 From: corentin-sodebo-voile <93916863+corentin-sodebo-voile@users.noreply.github.com> Date: Thu, 23 May 2024 15:30:13 +0200 Subject: [PATCH] Fix panning with middle mouse button on windows 10/11 Without preventDefault, when you try to drag the canvas with middle mouse button on Windows (e.g. in Chrome), the cursor change to a "scroll cursor" and the canvas scrolls endlessly instead of being dragged accurately. --- packages/node_modules/@node-red/editor-client/src/js/ui/view.js | 1 + 1 file changed, 1 insertion(+) 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 a2571dc28..e71478457 100644 --- 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 @@ -1190,6 +1190,7 @@ RED.view = (function() { if (d3.event.button === 1) { // Middle Click pan + d3.event.preventDefault(); mouse_mode = RED.state.PANNING; mouse_position = [d3.event.pageX,d3.event.pageY] scroll_position = [chart.scrollLeft(),chart.scrollTop()];