From 4be66d7132f52910d08747746f6f4246a39a79f7 Mon Sep 17 00:00:00 2001 From: Sebastiano Gallo Date: Fri, 13 Feb 2026 16:32:42 +0100 Subject: [PATCH 1/2] FIX: Support new 'element' prop in comfyui frontend The new comfyui-frontend versions don't use the 'inputEl' prop anymore, they use 'element' prop. This change supports the new prop and is backwards compatible --- web/js/main.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/web/js/main.js b/web/js/main.js index 4673fa5..c0edef1 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -50,18 +50,21 @@ function initializeEventHandlers() { ComfyWidgets.STRING = function (node, inputName, inputData, appInstance) { // Use appInstance to avoid conflict with global app const result = originalStringWidget.apply(this, arguments); - // Check if the widget has an inputEl and if it's a TEXTAREA + // Check if the widget has an element and if it's a TEXTAREA // This is to ensure we are targeting multiline text inputs, related to '.comfy-multiline-input' - if (result && result.widget - && result.widget.inputEl && result.widget.inputEl.tagName === 'TEXTAREA' && !result.widget.inputEl.readOnly) { - const widgetConfig = inputData && inputData[1] ? inputData[1] : {}; - // Future: Add checks for Autocomplete Plus specific configurations if needed - // e.g., if (widgetConfig["AutocompletePlus.enabled"] === false) return result; + if (result && result.widget) { + // fallback for older Comfyui frontend versions + const inputEl = result.widget.element ?? result.widget.inputEl; + if (inputEl && inputEl.tagName === 'TEXTAREA' && !inputEl.readOnly) { + const widgetConfig = inputData && inputData[1] ? inputData[1] : {}; + // Future: Add checks for Autocomplete Plus specific configurations if needed + // e.g., if (widgetConfig["AutocompletePlus.enabled"] === false) return result; - const nodeInfo = new NodeInfo(node.comfyClass || node.constructor.name, inputName); - attachListeners(result.widget.inputEl, nodeInfo); + const nodeInfo = new NodeInfo(node.comfyClass || node.constructor.name, inputName); + attachListeners(inputEl, nodeInfo); + } + return result; } - return result; }; } @@ -535,4 +538,4 @@ app.registerExtension({ }, }, ] -}); \ No newline at end of file +}); From 5aa72379e86000a5eff03f7dc8f93212b7d06299 Mon Sep 17 00:00:00 2001 From: Sebastiano Gallo Date: Wed, 18 Feb 2026 13:56:10 +0100 Subject: [PATCH 2/2] outer return statement --- web/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/main.js b/web/js/main.js index c0edef1..0b9838e 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -63,8 +63,8 @@ function initializeEventHandlers() { const nodeInfo = new NodeInfo(node.comfyClass || node.constructor.name, inputName); attachListeners(inputEl, nodeInfo); } - return result; } + return result; }; }