diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index 1e2be3dea4..3eca0b1b22 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -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 { if (this._params!.confirm) { this._params!.confirm(this._value); diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index b078c127c6..8caa6dccf5 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -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, {