From ecb7fa4f0beb1e8db5de638f9044b1753ca3bb86 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:26:36 +1100 Subject: [PATCH] Fix widget not updating on combo click (#321) --- src/LGraphCanvas.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index b1e1712d7..4933fc5aa 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -2295,7 +2295,6 @@ export class LGraphCanvas { // Left/right arrows if (delta) { - console.warn("DELTA", delta) let index = -1 this.last_mouseclick = 0 //avoids dobl click event index = typeof values === "object" @@ -2309,9 +2308,11 @@ export class LGraphCanvas { widget.value = Array.isArray(values) ? values[index] : index + + if (oldValue != widget.value) setWidgetValue(this, node, widget, widget.value) + this.dirty_canvas = true return } - console.warn("MENU", delta) const text_values = values != values_list ? Object.values(values) : values new LiteGraph.ContextMenu(text_values, { scale: Math.max(1, this.ds.scale), @@ -2328,11 +2329,6 @@ export class LGraphCanvas { } }) } - - // TODO: setTimeout why - if (oldValue != widget.value) - setTimeout(() => setWidgetValue(this, node, widget, widget.value), 20) - this.dirty_canvas = true break } case "toggle":