mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 13:26:34 +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
|
||||
.value=${this._value}
|
||||
@value-changed=${this._valueChanged}
|
||||
@keyup=${this._handleKeyUp}
|
||||
.label=${this._params.inputLabel
|
||||
? this._params.inputLabel
|
||||
: ""}
|
||||
@ -112,6 +113,12 @@ class DialogBox extends LitElement {
|
||||
this._params = undefined;
|
||||
}
|
||||
|
||||
private _handleKeyUp(ev: KeyboardEvent) {
|
||||
if (ev.keyCode === 13) {
|
||||
this._confirm();
|
||||
}
|
||||
}
|
||||
|
||||
private async _confirm(): Promise<void> {
|
||||
if (this._params!.confirm) {
|
||||
this._params!.confirm(this._value);
|
||||
|
@ -521,7 +521,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
||||
"ui.panel.config.integrations.rename_input_label"
|
||||
),
|
||||
});
|
||||
if (!newName) {
|
||||
if (newName === null) {
|
||||
return;
|
||||
}
|
||||
const newEntry = await updateConfigEntry(this.hass, configEntry.entry_id, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user