From 482c8cfdee6507aa7262cbedfef25ce65260fdd1 Mon Sep 17 00:00:00 2001 From: Mehdi Chaid Date: Wed, 20 May 2026 18:37:01 -0400 Subject: [PATCH] fix: Into Flake Data (Select) hidden widgets catching pointer events (#214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous approach (`hideIntoWidgets`) flagged optional widgets as hidden and zeroed their compute size, but left them in node.widgets. Canvas-drawn LiteGraph widgets that remain attached to the node still have a hit-test region — they intercepted clicks meant for the new custom dropdown / + button, changing the cursor and opening the hidden widget's editor instead of the dropdown. Rename to `removeIntoWidgets` and actually splice these widgets out of node.widgets so there is no hit region left. Add an idempotency guard on setupIntoFlakeDataSelect so the second call (from onConfigure) is a no-op rather than re-adding the DOM widget twice. Closes #214 --- web/widgets/flake-data-select.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/web/widgets/flake-data-select.js b/web/widgets/flake-data-select.js index 638e3db..f6b1f88 100644 --- a/web/widgets/flake-data-select.js +++ b/web/widgets/flake-data-select.js @@ -198,23 +198,29 @@ const OPTIONAL_WIDGET_NAMES = new Set([ "filename_prefix", "width", "height", "steps", "cfg", "sampler_name", "scheduler" ]); -function hideIntoWidgets(node) { +function removeIntoWidgets(node) { if (!node.widgets) return; - for (const w of node.widgets) { + for (let i = node.widgets.length - 1; i >= 0; i--) { + const w = node.widgets[i]; if (!OPTIONAL_WIDGET_NAMES.has(w.name)) continue; - w.computeSize = () => [0, -4]; - w.type = "hidden"; - w.hidden = true; if (w.element) { w.element.remove(); w.element = null; } if (w.inputEl) { w.inputEl.remove(); w.inputEl = null; } + node.widgets.splice(i, 1); } } export function setupIntoFlakeDataSelect(node) { if (!node.properties) node.properties = {}; + if (node._intoSetupDone) { + node._intoPinUpdate?.(); + return; + } + node._intoSetupDone = true; - // Hide auto-created widgets for optional fields — pins are managed dynamically. - hideIntoWidgets(node); + // Fully remove auto-created widgets for optional fields — pins are managed dynamically. + // (Previously these were hidden but the canvas-drawn widgets still caught clicks, + // hijacking clicks meant for the dropdown / + button.) + removeIntoWidgets(node); // Remove any pre-existing optional inputs that Python adds automatically. // Keep only flake_data.