mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 18:10:08 +00:00
[Bug] Fix link drop on widget (#860)
Resolves https://github.com/Comfy-Org/litegraph.js/issues/857
This commit is contained in:
@@ -519,9 +519,18 @@ export class LinkConnector {
|
||||
}
|
||||
|
||||
isNodeValidDrop(node: LGraphNode): boolean {
|
||||
return this.state.connectingTo === "output"
|
||||
? node.outputs.some(output => this.renderLinks.some(link => link.canConnectToOutput(node, output)))
|
||||
: node.inputs.some(input => this.renderLinks.some(link => link.canConnectToInput(node, input)))
|
||||
if (this.state.connectingTo === "output") {
|
||||
return node.outputs.some(output => this.renderLinks.some(link => link.canConnectToOutput(node, output)))
|
||||
}
|
||||
|
||||
// If the node has widgets, some of them might be able to be converted to
|
||||
// input slots on drop. The logic is handled in
|
||||
// https://github.com/Comfy-Org/ComfyUI_frontend/blob/4d35d937cfec5dd802fc1b24916883293f3cbb9e/src/extensions/core/widgetInputs.ts#L670-L695
|
||||
if (node.widgets?.length) {
|
||||
return true
|
||||
}
|
||||
|
||||
return node.inputs.some(input => this.renderLinks.some(link => link.canConnectToInput(node, input)))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user