mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 23:20:07 +00:00
Disconnect moved output links when dropped on canvas (#936)
- Resolves #884
This commit is contained in:
@@ -446,6 +446,12 @@ export class LinkConnector {
|
||||
link.inputNode.disconnectInput(link.inputIndex, true)
|
||||
}
|
||||
}
|
||||
} else if (this.state.connectingTo === "output") {
|
||||
for (const link of this.renderLinks) {
|
||||
if (link instanceof MovingOutputLink) {
|
||||
link.outputNode.disconnectOutput(link.outputIndex, link.inputNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -499,6 +499,9 @@ describe("LinkConnector Integration", () => {
|
||||
expect(connector.isRerouteValidDrop(reroute7)).toBe(false)
|
||||
expect(connector.isRerouteValidDrop(reroute10)).toBe(false)
|
||||
expect(connector.isRerouteValidDrop(reroute13)).toBe(false)
|
||||
|
||||
// Prevent link disconnect when dropped on canvas (just for this test)
|
||||
connector.events.addEventListener("dropped-on-canvas", e => e.preventDefault(), { once: true })
|
||||
connector.dropLinks(graph, reroute7Event)
|
||||
connector.reset()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user