From d3f29362b9f554eba58dcd228c393cb20a86a4c4 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 9 Jul 2020 01:29:46 +0200 Subject: [PATCH] Fix optional with default value ha-form-integer (#6341) --- src/components/ha-form/ha-form-integer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ha-form/ha-form-integer.ts b/src/components/ha-form/ha-form-integer.ts index 0e5674edfb..e00aa40a0e 100644 --- a/src/components/ha-form/ha-form-integer.ts +++ b/src/components/ha-form/ha-form-integer.ts @@ -58,7 +58,9 @@ export class HaFormInteger extends LitElement implements HaFormElement { .value=${this._value} .min=${this.schema.valueMin} .max=${this.schema.valueMax} - .disabled=${this.data === undefined} + .disabled=${this.data === undefined && + this.schema.optional && + this.schema.default === undefined} @value-changed=${this._valueChanged} >