diff --git a/src/renderer/core/canvas/links/linkDropOrchestrator.ts b/src/renderer/core/canvas/links/linkDropOrchestrator.ts index 086a2dc8b..6e3fec991 100644 --- a/src/renderer/core/canvas/links/linkDropOrchestrator.ts +++ b/src/renderer/core/canvas/links/linkDropOrchestrator.ts @@ -20,7 +20,9 @@ export const resolveSlotTargetCandidate = ( const { state: dragState, setCompatibleForKey } = useSlotLinkDragUIState() if (!(target instanceof HTMLElement)) return null - const elWithKey = target.closest('[data-slot-key]') + const elWithKey = target + .closest('.lg-slot, .lg-node-widget') + ?.querySelector('[data-slot-key]') const key = elWithKey?.dataset['slotKey'] if (!key) return null diff --git a/src/renderer/extensions/vueNodes/components/NodeWidgets.vue b/src/renderer/extensions/vueNodes/components/NodeWidgets.vue index 18fe8cc56..f843897e3 100644 --- a/src/renderer/extensions/vueNodes/components/NodeWidgets.vue +++ b/src/renderer/extensions/vueNodes/components/NodeWidgets.vue @@ -19,7 +19,7 @@
diff --git a/src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts b/src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts index f93885e88..3baf2b047 100644 --- a/src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts +++ b/src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts @@ -301,14 +301,12 @@ export function useSlotLinkInteraction({ hoveredSlotKey = dragContext.lastPointerTargetSlotKey hoveredNodeId = dragContext.lastPointerTargetNodeId } else if (target instanceof HTMLElement) { - const elWithSlot = target.closest('[data-slot-key]') - const elWithNode = elWithSlot - ? null - : target.closest('[data-node-id]') + const elWithSlot = target + .closest('.lg-slot, .lg-node-widget') + ?.querySelector('[data-slot-key]') + const elWithNode = target.closest('[data-node-id]') hoveredSlotKey = elWithSlot?.dataset['slotKey'] ?? null - hoveredNodeId = hoveredSlotKey - ? null - : (elWithNode?.dataset['nodeId'] ?? null) + hoveredNodeId = elWithNode?.dataset['nodeId'] ?? null dragContext.lastPointerEventTarget = target dragContext.lastPointerTargetSlotKey = hoveredSlotKey dragContext.lastPointerTargetNodeId = hoveredNodeId @@ -325,10 +323,8 @@ export function useSlotLinkInteraction({ const graph = app.canvas?.graph ?? null const context = { adapter, graph, session: dragContext } const slotCandidate = resolveSlotTargetCandidate(target, context) - const nodeCandidate = slotCandidate - ? null - : resolveNodeSurfaceSlotCandidate(target, context) - candidate = slotCandidate ?? nodeCandidate + const nodeCandidate = resolveNodeSurfaceSlotCandidate(target, context) + candidate = slotCandidate?.compatible ? slotCandidate : nodeCandidate dragContext.lastHoverSlotKey = hoveredSlotKey dragContext.lastHoverNodeId = hoveredNodeId @@ -339,7 +335,8 @@ export function useSlotLinkInteraction({ slotCandidate.layout.type === 'input' ) setCompatibleForKey(key, !!slotCandidate.compatible) - } else if (nodeCandidate) { + } + if (nodeCandidate && !slotCandidate?.compatible) { const key = getSlotKey( nodeCandidate.layout.nodeId, nodeCandidate.layout.index,