[Cleanup] Remove manual double click delay (#2840)

This commit is contained in:
Chenlei Hu
2025-03-03 17:36:26 -05:00
committed by GitHub
parent e1f23bf02e
commit b2f3d85e24

View File

@@ -866,7 +866,6 @@ app.registerExtension({
// Double click a widget input to automatically attach a primitive
const origOnInputDblClick = nodeType.prototype.onInputDblClick
const ignoreDblClick = Symbol()
nodeType.prototype.onInputDblClick = function (
this: LGraphNode,
slot: number
@@ -876,7 +875,7 @@ app.registerExtension({
: undefined
const input = this.inputs[slot]
if (!input.widget || !input[ignoreDblClick]) {
if (!input.widget) {
// Not a widget input or already handled input
if (
!(input.type in ComfyWidgets) &&
@@ -903,12 +902,6 @@ app.registerExtension({
node.connect(0, this, slot)
node.title = input.name
// Prevent adding duplicates due to triple clicking
input[ignoreDblClick] = true
setTimeout(() => {
delete input[ignoreDblClick]
}, 300)
return r
}
},