From 817ed121edd850e3763fab37bf2e9c3d973ff493 Mon Sep 17 00:00:00 2001 From: webfiltered <176114999+webfiltered@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:42:13 +1000 Subject: [PATCH] Fix empty input not used when connecting links When dragging a link onto a node, it will always replace the first matching input type, unless you drop in the (respectively tiny) input hit box. This commit fixes that, honouring the intended behaviour (preferFreeSlot is true in internal calls). --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 2881c4901..7d6d71048 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -4048,7 +4048,7 @@ if (aSource[sI]=="*") aSource[sI] = 0; if (aDest[sI]=="*") aDest[sI] = 0; if (aSource[sI] == aDest[dI]) { - if (preferFreeSlot && aSlots[i].links && aSlots[i].links !== null) continue; + if (preferFreeSlot && (aSlots[i].links && aSlots[i].links !== null) || (aSlots[i].link && aSlots[i].link !== null)) continue; return !returnObj ? i : aSlots[i]; } }