mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-10 03:19:44 +00:00
Fix autocorrect and spellcheck for ha-textfield (#17274)
This commit is contained in:
@@ -17,6 +17,11 @@ export class HaTextField extends TextFieldBase {
|
||||
|
||||
@property() public autocomplete?: string;
|
||||
|
||||
@property() public autocorrect?: string;
|
||||
|
||||
@property({ attribute: "input-spellcheck" })
|
||||
public inputSpellcheck?: string;
|
||||
|
||||
@query("input") public formElement!: HTMLInputElement;
|
||||
|
||||
override updated(changedProperties: PropertyValues) {
|
||||
@@ -38,6 +43,20 @@ export class HaTextField extends TextFieldBase {
|
||||
this.formElement.removeAttribute("autocomplete");
|
||||
}
|
||||
}
|
||||
if (changedProperties.has("autocorrect")) {
|
||||
if (this.autocorrect) {
|
||||
this.formElement.setAttribute("autocorrect", this.autocorrect);
|
||||
} else {
|
||||
this.formElement.removeAttribute("autocorrect");
|
||||
}
|
||||
}
|
||||
if (changedProperties.has("inputSpellcheck")) {
|
||||
if (this.inputSpellcheck) {
|
||||
this.formElement.setAttribute("spellcheck", this.inputSpellcheck);
|
||||
} else {
|
||||
this.formElement.removeAttribute("spellcheck");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override renderIcon(
|
||||
|
||||
Reference in New Issue
Block a user