From 78211207067a80b4d749929c223506cceffe4f42 Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Wed, 29 Oct 2025 11:43:57 -0700 Subject: [PATCH] fix: Count dragging slot as a free slot for targeting (#6370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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) --- src/lib/litegraph/src/LGraphNode.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/litegraph/src/LGraphNode.ts b/src/lib/litegraph/src/LGraphNode.ts index b65b0d7f49..23326e24ff 100644 --- a/src/lib/litegraph/src/LGraphNode.ts +++ b/src/lib/litegraph/src/LGraphNode.ts @@ -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 + ) } /**