From f9d249218941eb161f8e05dd11035e9fabd76ff4 Mon Sep 17 00:00:00 2001 From: relhamdi Date: Thu, 21 May 2026 11:09:45 +0200 Subject: [PATCH] Fix options not resetting when option text is emptied --- web/prompt_option_picker.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/prompt_option_picker.js b/web/prompt_option_picker.js index 585a7b6..4718507 100644 --- a/web/prompt_option_picker.js +++ b/web/prompt_option_picker.js @@ -18,14 +18,21 @@ function attachOptionPicker(node) { if (!raw.trim()) return null; const lines = raw.split("\n").map((l) => l.trim()); - if (!lines.length) return null; + const hasContent = lines.some((l) => l !== ""); + if (!hasContent) return null; return lines.map((l) => (l === "" ? "--" : l)); }; const refreshDropdown = () => { const options = parseOptions(); - if (!options) return; + if (!options) { + // Reset dropdown to default empty state + selectedWidget.options.values = ["--"]; + selectedWidget.value = "--"; + if (node.graph) node.graph.setDirtyCanvas(true, true); + return; + } const current = selectedWidget.value; selectedWidget.options.values = options;