diff --git a/src/components/graph/NodeContextMenu.vue b/src/components/graph/NodeContextMenu.vue index 632108274..8382a43ec 100644 --- a/src/components/graph/NodeContextMenu.vue +++ b/src/components/graph/NodeContextMenu.vue @@ -263,7 +263,7 @@ function onMenuHide() { } onMounted(() => { - registerNodeOptionsInstance({ toggle, hide, isOpen }) + registerNodeOptionsInstance({ toggle, show, hide, isOpen }) }) onUnmounted(() => { diff --git a/src/composables/graph/useMoreOptionsMenu.ts b/src/composables/graph/useMoreOptionsMenu.ts index 061072e4a..96c677cd5 100644 --- a/src/composables/graph/useMoreOptionsMenu.ts +++ b/src/composables/graph/useMoreOptionsMenu.ts @@ -55,11 +55,23 @@ export function toggleNodeOptions(event: Event) { } } +/** + * Show the node options popover (always shows, doesn't toggle) + * Use this for contextmenu events where we always want to show at the new position + * @param event - The trigger event (must be MouseEvent for position) + */ +export function showNodeOptions(event: MouseEvent) { + if (nodeOptionsInstance?.show) { + nodeOptionsInstance.show(event) + } +} + /** * Hide the node options popover */ interface NodeOptionsInstance { toggle: (event: Event) => void + show: (event: MouseEvent) => void hide: () => void isOpen: Ref } diff --git a/src/renderer/extensions/vueNodes/components/LGraphNode.vue b/src/renderer/extensions/vueNodes/components/LGraphNode.vue index d11430fc6..f32b14c1c 100644 --- a/src/renderer/extensions/vueNodes/components/LGraphNode.vue +++ b/src/renderer/extensions/vueNodes/components/LGraphNode.vue @@ -136,7 +136,7 @@ import { computed, nextTick, onErrorCaptured, onMounted, ref, watch } from 'vue' import { useI18n } from 'vue-i18n' import type { VueNodeData } from '@/composables/graph/useGraphNodeManager' -import { toggleNodeOptions } from '@/composables/graph/useMoreOptionsMenu' +import { showNodeOptions } from '@/composables/graph/useMoreOptionsMenu' import { useErrorHandling } from '@/composables/useErrorHandling' import { st } from '@/i18n' import { @@ -290,7 +290,7 @@ const handleContextMenu = (event: MouseEvent) => { handleNodeRightClick(event as PointerEvent, nodeData.id) // Show the node options menu at the cursor position - toggleNodeOptions(event) + showNodeOptions(event) } onMounted(() => {