From 431fe33ea31a6806f365c341a307cc1f027522c9 Mon Sep 17 00:00:00 2001 From: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:41:18 +0100 Subject: [PATCH] fix: preserve node selection on right-click (#7162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, right-clicking on a Vue node would deselect all other selected nodes because the pointerup event handler was calling toggleNodeSelectionAfterPointerUp regardless of which mouse button was released. This fix skips selection handling when the right mouse button (button 2) is released, allowing the context menu to operate on the existing selection. ## Summary - Fixes right-click deselecting all selected nodes when using Vue node rendering - Now right-clicking preserves the existing selection, allowing context menu actions on multiple nodes ## Problem When multiple nodes were selected and user right-clicked on one of them, the `pointerup` event handler would call `toggleNodeSelectionAfterPointerUp`, which deselected everything except the clicked node. This broke multi-node context menu operations. ## Solution Skip selection handling in `onPointerup` when `event.button === 2` (right-click). The context menu handler manages selection independently fix https://github.com/Comfy-Org/ComfyUI_frontend/issues/7136 Before https://github.com/user-attachments/assets/23ac5e03-c464-44b7-8950-67c14da9e02b After https://github.com/user-attachments/assets/9d1bd6a8-6386-442b-9dc4-6bc8fbe4a0a8 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7162-fix-preserve-node-selection-on-right-click-2bf6d73d365081acaf75f2fc845bbffb) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action --- .../vueNodes/composables/useNodePointerInteractions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts b/src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts index 26d2b8a4b0..d3461d4c39 100644 --- a/src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts +++ b/src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts @@ -127,6 +127,10 @@ export function useNodePointerInteractions( safeDragEnd(event) return } + + // Skip selection handling for right-click (button 2) - context menu handles its own selection + if (event.button === 2) return + const multiSelect = isMultiSelectKey(event) const nodeId = toValue(nodeIdRef)