Skip to content

Commit

Permalink
Fix number selector display for 0 (#18927)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored Dec 6, 2023
1 parent 39260d1 commit a820ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/ha-selector/ha-selector-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit a820ca1

Please sign in to comment.