mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Name field in helper forms should not init in the error state (#17111)
This commit is contained in:
parent
ede7daad1a
commit
e7c47ef65c
@ -64,7 +64,6 @@ class HaCounterForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -75,10 +74,11 @@ class HaCounterForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -42,7 +42,6 @@ class HaInputBooleanForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -53,10 +52,11 @@ class HaInputBooleanForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -42,7 +42,6 @@ class HaInputButtonForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -53,10 +52,11 @@ class HaInputButtonForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -56,7 +56,6 @@ class HaInputDateTimeForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -67,10 +66,11 @@ class HaInputDateTimeForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -71,7 +71,6 @@ class HaInputNumberForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -82,10 +81,11 @@ class HaInputNumberForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -54,20 +54,20 @@ class HaInputSelectForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
<ha-textfield
|
||||
dialogInitialFocus
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.value=${this._name}
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
.configValue=${"name"}
|
||||
@input=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
|
@ -61,7 +61,6 @@ class HaInputTextForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -72,10 +71,11 @@ class HaInputTextForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -141,7 +141,6 @@ class HaScheduleForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -152,10 +151,11 @@ class HaScheduleForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
@ -50,7 +50,6 @@ class HaTimerForm extends LitElement {
|
||||
if (!this.hass) {
|
||||
return nothing;
|
||||
}
|
||||
const nameInvalid = !this._name || this._name.trim() === "";
|
||||
|
||||
return html`
|
||||
<div class="form">
|
||||
@ -61,10 +60,11 @@ class HaTimerForm extends LitElement {
|
||||
.label=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.generic.name"
|
||||
)}
|
||||
.errorMessage=${this.hass!.localize(
|
||||
autoValidate
|
||||
required
|
||||
.validationMessage=${this.hass!.localize(
|
||||
"ui.dialogs.helper_settings.required_error_msg"
|
||||
)}
|
||||
.invalid=${nameInvalid}
|
||||
dialogInitialFocus
|
||||
></ha-textfield>
|
||||
<ha-icon-picker
|
||||
|
Loading…
x
Reference in New Issue
Block a user