Allow disabling an ha-form (#10218)

This commit is contained in:
Paulus Schoutsen
2021-10-09 03:41:36 -07:00
committed by GitHub
parent 774f22b7e7
commit 9bf41a37b4
12 changed files with 85 additions and 18 deletions

View File

@@ -28,6 +28,8 @@ export class HaFormString extends LitElement implements HaFormElement {
@property() public label!: string;
@property({ type: Boolean }) public disabled = false;
@state() private _unmaskedPassword = false;
@query("mwc-textfield") private _input?: HTMLElement;
@@ -51,6 +53,7 @@ export class HaFormString extends LitElement implements HaFormElement {
: "password"}
.label=${this.label}
.value=${this.data || ""}
.disabled=${this.disabled}
.required=${this.schema.required}
.autoValidate=${this.schema.required}
.suffix=${isPassword