From 3984408d054aa2105b396df6527f4ba4ba775db4 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 25 Feb 2026 23:44:33 -0800 Subject: [PATCH] docs: add comment explaining widget value store dom widgets getter nuance (#9202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds comment explaining nuance with the differing registration semantics between DOM widget vs base widet. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9202-fix-widget-value-store-dom-widgets-getter-3126d73d365081368b94f048efb101fa) by [Unito](https://www.unito.io) --- src/lib/litegraph/src/widgets/BaseWidget.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/litegraph/src/widgets/BaseWidget.ts b/src/lib/litegraph/src/widgets/BaseWidget.ts index 1406e0bb79..973e7976da 100644 --- a/src/lib/litegraph/src/widgets/BaseWidget.ts +++ b/src/lib/litegraph/src/widgets/BaseWidget.ts @@ -140,6 +140,9 @@ export abstract class BaseWidget this._state = useWidgetValueStore().registerWidget(graphId, { ...this._state, + // BaseWidget: this.value getter returns this._state.value. So value: this.value === value: this._state.value. + // BaseDOMWidgetImpl: this.value getter returns options.getValue?.() ?? ''. Resolves the correct initial value instead of undefined. + // I.e., calls overriden getter -> options.getValue() -> correct value (https://github.com/Comfy-Org/ComfyUI_frontend/issues/9194). value: this.value, nodeId })