Skip to content

Commit 431fe33

Browse files
fix: preserve node selection on right-click (#7162)
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 #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 <[email protected]>
1 parent 5233749 commit 431fe33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ export function useNodePointerInteractions(
127127
safeDragEnd(event)
128128
return
129129
}
130+
131+
// Skip selection handling for right-click (button 2) - context menu handles its own selection
132+
if (event.button === 2) return
133+
130134
const multiSelect = isMultiSelectKey(event)
131135

132136
const nodeId = toValue(nodeIdRef)

0 commit comments

Comments
 (0)