From a820ca1e90d9c77b95687ef0c5965b8ddb3985cf Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:03:44 -0800 Subject: [PATCH] Fix number selector display for 0 (#18927) --- src/components/ha-selector/ha-selector-number.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ha-selector/ha-selector-number.ts b/src/components/ha-selector/ha-selector-number.ts index 1e913e09b416..3bc9451e1807 100644 --- a/src/components/ha-selector/ha-selector-number.ts +++ b/src/components/ha-selector/ha-selector-number.ts @@ -30,9 +30,9 @@ export class HaNumberSelector extends LitElement { protected willUpdate(changedProps: PropertyValues) { if (changedProps.has("value")) { - if (this.value !== Number(this._valueStr)) { + if (this._valueStr === "" || this.value !== Number(this._valueStr)) { this._valueStr = - !this.value || isNaN(this.value) ? "" : this.value.toString(); + this.value == null || isNaN(this.value) ? "" : this.value.toString(); } } }