Hide widget values when computedDisabled is true (#1109)

This commit is contained in:
filtered
2025-07-08 14:04:58 +10:00
committed by GitHub
parent 914c3e4705
commit e93da6bce4
3 changed files with 3 additions and 1 deletions

View File

@@ -142,7 +142,7 @@ export abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget> impl
// TODO: Resolve this workaround. Ref: https://github.com/Comfy-Org/litegraph.js/issues/1022
get _displayValue(): string {
return String(this.value)
return this.computedDisabled ? "" : String(this.value)
}
get labelBaseline() {

View File

@@ -23,6 +23,7 @@ export class ComboWidget extends BaseSteppedWidget<IStringComboWidget | IComboWi
override type = "combo" as const
override get _displayValue() {
if (this.computedDisabled) return ""
const { values: rawValues } = this.options
if (rawValues) {
const values = typeof rawValues === "function" ? rawValues() : rawValues

View File

@@ -9,6 +9,7 @@ export class NumberWidget extends BaseSteppedWidget<INumericWidget> implements I
override type = "number" as const
override get _displayValue() {
if (this.computedDisabled) return ""
return Number(this.value).toFixed(
this.options.precision !== undefined
? this.options.precision