@@ -301,14 +301,12 @@ export function useSlotLinkInteraction({
301301 hoveredSlotKey = dragContext . lastPointerTargetSlotKey
302302 hoveredNodeId = dragContext . lastPointerTargetNodeId
303303 } else if ( target instanceof HTMLElement ) {
304- const elWithSlot = target . closest < HTMLElement > ( '[data-slot-key]' )
305- const elWithNode = elWithSlot
306- ? null
307- : target . closest < HTMLElement > ( '[data-node-id]' )
304+ const elWithSlot = target
305+ . closest ( '.lg-slot, .lg-node-widget' )
306+ ?. querySelector < HTMLElement > ( '[data-slot-key]' )
307+ const elWithNode = target . closest < HTMLElement > ( '[data-node-id]' )
308308 hoveredSlotKey = elWithSlot ?. dataset [ 'slotKey' ] ?? null
309- hoveredNodeId = hoveredSlotKey
310- ? null
311- : ( elWithNode ?. dataset [ 'nodeId' ] ?? null )
309+ hoveredNodeId = elWithNode ?. dataset [ 'nodeId' ] ?? null
312310 dragContext . lastPointerEventTarget = target
313311 dragContext . lastPointerTargetSlotKey = hoveredSlotKey
314312 dragContext . lastPointerTargetNodeId = hoveredNodeId
@@ -325,10 +323,8 @@ export function useSlotLinkInteraction({
325323 const graph = app . canvas ?. graph ?? null
326324 const context = { adapter, graph, session : dragContext }
327325 const slotCandidate = resolveSlotTargetCandidate ( target , context )
328- const nodeCandidate = slotCandidate
329- ? null
330- : resolveNodeSurfaceSlotCandidate ( target , context )
331- candidate = slotCandidate ?? nodeCandidate
326+ const nodeCandidate = resolveNodeSurfaceSlotCandidate ( target , context )
327+ candidate = slotCandidate ?. compatible ? slotCandidate : nodeCandidate
332328 dragContext . lastHoverSlotKey = hoveredSlotKey
333329 dragContext . lastHoverNodeId = hoveredNodeId
334330
@@ -339,7 +335,8 @@ export function useSlotLinkInteraction({
339335 slotCandidate . layout . type === 'input'
340336 )
341337 setCompatibleForKey ( key , ! ! slotCandidate . compatible )
342- } else if ( nodeCandidate ) {
338+ }
339+ if ( nodeCandidate && ! slotCandidate ?. compatible ) {
343340 const key = getSlotKey (
344341 nodeCandidate . layout . nodeId ,
345342 nodeCandidate . layout . index ,
0 commit comments