From 39cc8ab97ab26aa46354cabf81936454dd2153e8 Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Mon, 16 Feb 2026 15:40:36 -0800 Subject: [PATCH] A heavy-handed fix for middlemouse pan (#8865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes, middle mouse clicks would fail to initiate a canvas pan, depending on the target of the initial pan. This PR adds a capturing event handler to the transform pane that forwards the pointer event to canvas if - It is a middle mouse click - The target element is not a focused text element Resolves #6911 While testing this, I encountered infrequent cases of "some nodes unintentionally translating continually to the left". Reproduction was too unreliable to properly track down, but did appear unrelated to this PR. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8865-A-heavy-handed-fix-for-middlemouse-pan-3076d73d365081ea9a4ddd5786fc647a) by [Unito](https://www.unito.io) --- src/components/graph/GraphCanvas.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue index e12e5fd8a0..d15eee0e8e 100644 --- a/src/components/graph/GraphCanvas.vue +++ b/src/components/graph/GraphCanvas.vue @@ -60,6 +60,9 @@ v-if="shouldRenderVueNodes && comfyApp.canvas && comfyAppReady" :canvas="comfyApp.canvas" @wheel.capture="canvasInteractions.forwardEventToCanvas" + @pointerdown.capture="forwardPanEvent" + @pointerup.capture="forwardPanEvent" + @pointermove.capture="forwardPanEvent" > { onUnmounted(() => { vueNodeLifecycle.cleanup() }) +function forwardPanEvent(e: PointerEvent) { + if ( + (shouldIgnoreCopyPaste(e.target) && document.activeElement === e.target) || + !isMiddlePointerInput(e) + ) + return + + canvasInteractions.forwardEventToCanvas(e) +}