mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 21:36:36 +00:00
Allow to remove config entry name (#5607)
* Allow to remove config entry name * Add enter handling to prompt
This commit is contained in:
parent
49f2fd2af7
commit
301a964a65
@ -72,6 +72,7 @@ class DialogBox extends LitElement {
|
|||||||
autofocus
|
autofocus
|
||||||
.value=${this._value}
|
.value=${this._value}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
|
@keyup=${this._handleKeyUp}
|
||||||
.label=${this._params.inputLabel
|
.label=${this._params.inputLabel
|
||||||
? this._params.inputLabel
|
? this._params.inputLabel
|
||||||
: ""}
|
: ""}
|
||||||
@ -112,6 +113,12 @@ class DialogBox extends LitElement {
|
|||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _handleKeyUp(ev: KeyboardEvent) {
|
||||||
|
if (ev.keyCode === 13) {
|
||||||
|
this._confirm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async _confirm(): Promise<void> {
|
private async _confirm(): Promise<void> {
|
||||||
if (this._params!.confirm) {
|
if (this._params!.confirm) {
|
||||||
this._params!.confirm(this._value);
|
this._params!.confirm(this._value);
|
||||||
|
@ -521,7 +521,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
|||||||
"ui.panel.config.integrations.rename_input_label"
|
"ui.panel.config.integrations.rename_input_label"
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
if (!newName) {
|
if (newName === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const newEntry = await updateConfigEntry(this.hass, configEntry.entry_id, {
|
const newEntry = await updateConfigEntry(this.hass, configEntry.entry_id, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user