fix: Count dragging slot as a free slot for targeting (#6370)

## Summary

Prioritizes the slot that previously held the link instead of the first
valid slot for a given type.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6370-fix-Count-dragging-slot-as-a-free-slot-for-targeting-29b6d73d365081709034e272cef38320)
by [Unito](https://www.unito.io)
This commit is contained in:
Alexander Brown
2025-10-29 11:43:57 -07:00
committed by GitHub
parent b8e5d1ff90
commit 7821120706

View File

@@ -2569,7 +2569,12 @@ export class LGraphNode
findInputByType(
type: ISlotType
): { index: number; slot: INodeInputSlot } | undefined {
return findFreeSlotOfType(this.inputs, type, (input) => input.link == null)
return findFreeSlotOfType(
this.inputs,
type,
(input) =>
input.link == null || !!this.graph?.getLink(input.link)?._dragging
)
}
/**