mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix autocorrect and spellcheck for ha-textfield (#17274)
This commit is contained in:
parent
158a816f7a
commit
e2ec3b63ce
@ -173,7 +173,7 @@ export class HaComboBox extends LitElement {
|
|||||||
autocapitalize="none"
|
autocapitalize="none"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
spellcheck="false"
|
input-spellcheck="false"
|
||||||
.suffix=${html`<div
|
.suffix=${html`<div
|
||||||
style="width: 28px;"
|
style="width: 28px;"
|
||||||
role="none presentation"
|
role="none presentation"
|
||||||
|
@ -17,6 +17,11 @@ export class HaTextField extends TextFieldBase {
|
|||||||
|
|
||||||
@property() public autocomplete?: string;
|
@property() public autocomplete?: string;
|
||||||
|
|
||||||
|
@property() public autocorrect?: string;
|
||||||
|
|
||||||
|
@property({ attribute: "input-spellcheck" })
|
||||||
|
public inputSpellcheck?: string;
|
||||||
|
|
||||||
@query("input") public formElement!: HTMLInputElement;
|
@query("input") public formElement!: HTMLInputElement;
|
||||||
|
|
||||||
override updated(changedProperties: PropertyValues) {
|
override updated(changedProperties: PropertyValues) {
|
||||||
@ -38,6 +43,20 @@ export class HaTextField extends TextFieldBase {
|
|||||||
this.formElement.removeAttribute("autocomplete");
|
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(
|
protected override renderIcon(
|
||||||
|
@ -687,6 +687,10 @@ export class EntityRegistrySettingsEditor extends LitElement {
|
|||||||
required
|
required
|
||||||
@input=${this._entityIdChanged}
|
@input=${this._entityIdChanged}
|
||||||
iconTrailing
|
iconTrailing
|
||||||
|
autocapitalize="none"
|
||||||
|
autocomplete="off"
|
||||||
|
autocorrect="off"
|
||||||
|
input-spellcheck="false"
|
||||||
>
|
>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
@click=${this._copyEntityId}
|
@click=${this._copyEntityId}
|
||||||
|
@ -202,7 +202,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
autocapitalize="none"
|
autocapitalize="none"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
spellcheck="false"
|
input-spellcheck="false"
|
||||||
value="[[_state]]"
|
value="[[_state]]"
|
||||||
on-change="stateChanged"
|
on-change="stateChanged"
|
||||||
class="state-input"
|
class="state-input"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user