diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index 6e3aa60a52..39b449d3d7 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -207,6 +207,7 @@ export class DialogLovelaceDashboardDetail extends LitElement { slot="primaryAction" @click=${this._updateDashboard} .disabled=${urlInvalid || titleInvalid || this._submitting} + dialogInitialFocus > ${this._params.urlPath ? this._params.dashboard?.id diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts index 81d783000e..be2e3c9461 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts @@ -94,6 +94,7 @@ export class HuiCreateDialogCard .label=${this.hass!.localize( "ui.panel.lovelace.editor.cardpicker.by_card" )} + dialogInitialFocus > - + ${this.hass!.localize("ui.common.cancel")} diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 730378ed32..f11310b93b 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -207,6 +207,7 @@ export class HuiDialogEditCard @config-changed=${this._handleConfigChanged} @GUImode-changed=${this._handleGUIModeChanged} @editor-save=${this._save} + dialogInitialFocus >
@@ -242,7 +243,7 @@ export class HuiDialogEditCard ` : ""}
- + ${this.hass!.localize("ui.common.cancel")} ${this._cardConfig !== undefined && this._dirty diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts index 57ea84cb90..2ac61bee0f 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts @@ -92,7 +92,11 @@ export class HuiDialogSuggestCard extends LitElement { ` : ""}
- + ${this._params.yaml ? this.hass!.localize("ui.common.close") : this.hass!.localize("ui.common.cancel")} diff --git a/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts b/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts index 0a3cc7f721..dfeb478994 100644 --- a/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts +++ b/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts @@ -56,15 +56,20 @@ export class HuiCreateDialogHeaderFooter >
${headerFooterElements.map( - (headerFooter) => + (headerFooter, index) => html` -
+
${this.hass!.localize( `ui.panel.lovelace.editor.header-footer.types.${headerFooter.type}.name` )} @@ -83,6 +88,15 @@ export class HuiCreateDialogHeaderFooter } private async _handleHeaderFooterPicked(ev: CustomEvent): Promise { + if ( + ev instanceof KeyboardEvent && + ev.key !== "Enter" && + ev.key !== " " && + ev.key !== "Spacebar" + ) { + return; + } + const type = (ev.currentTarget as any).type; let config: LovelaceHeaderFooterConfig = { type }; diff --git a/src/panels/lovelace/editor/hui-dialog-save-config.ts b/src/panels/lovelace/editor/hui-dialog-save-config.ts index da724a1adc..d12d38fdb7 100644 --- a/src/panels/lovelace/editor/hui-dialog-save-config.ts +++ b/src/panels/lovelace/editor/hui-dialog-save-config.ts @@ -93,6 +93,7 @@ export class HuiSaveConfig extends LitElement implements HassDialog { ` @@ -115,6 +116,7 @@ export class HuiSaveConfig extends LitElement implements HassDialog { `}
diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts index 606d822967..5c5e3aa4b7 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts @@ -50,6 +50,7 @@ export class HuiDialogEditLovelace extends LitElement { .hass=${this.hass} .config=${this._config} @lovelace-config-changed=${this._ConfigChanged} + dialogInitialFocus >
diff --git a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts index 6a8984b322..3d763e3b1b 100644 --- a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts +++ b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts @@ -79,6 +79,7 @@ export class HuiDialogSelectView extends LitElement { @closed=${stopPropagation} fixedMenuPosition naturalMenuWidth + dialogInitialFocus > 1 ? html` - + ${this._config.views.map( (view, idx) => html` No config found.
`} - + ${this.hass!.localize("ui.common.cancel")} diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 3b981ee67a..6b54de03dd 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -183,7 +183,7 @@ export class HuiDialogEditView extends LitElement { .selected=${this._curTabIndex} @selected-item-changed=${this._handleTabSelected} > - ${this.hass!.localize( "ui.panel.lovelace.editor.edit_view.tab_settings" )}