[Bug] Fix slot link state corruption on moving link between sockets (#882)

Ref: https://github.com/Comfy-Org/litegraph.js/issues/881

This PR fixes the corrupted link state when moving link from one input
socket to another.
This commit is contained in:
Chenlei Hu
2025-04-04 14:28:41 -04:00
committed by GitHub
parent d17b86a6b8
commit 29c923e0e3
2 changed files with 3 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ export class MovingInputLink extends MovingLinkBase {
connectToInput(inputNode: LGraphNode, input: INodeInputSlot, events: LinkConnectorEventTarget): LLink | null | undefined {
if (input === this.inputSlot) return
this.inputNode.disconnectInput(this.inputIndex, true)
const link = this.outputNode.connectSlots(this.outputSlot, inputNode, input, this.fromReroute?.id)
if (link) events.dispatch("input-moved", this)
return link