Set initial focus for some more dialogs (#11676)

This commit is contained in:
Steve Repsher 2022-02-13 16:02:48 -05:00 committed by GitHub
parent db33c38e21
commit 7f90ffa82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 2 deletions

View File

@ -83,6 +83,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
.checked=${!this._disableNewEntities} .checked=${!this._disableNewEntities}
@change=${this._disableNewEntitiesChanged} @change=${this._disableNewEntitiesChanged}
.disabled=${this._submitting} .disabled=${this._submitting}
dialogInitialFocus
></ha-switch> ></ha-switch>
</ha-formfield> </ha-formfield>
${this._allowUpdatePolling() ${this._allowUpdatePolling()

View File

@ -71,6 +71,7 @@ class DialogMQTTDeviceDebugInfo extends LitElement {
<ha-switch <ha-switch
.checked=${this._showDeserialized} .checked=${this._showDeserialized}
@change=${this._showDeserializedChanged} @change=${this._showDeserializedChanged}
dialogInitialFocus
> >
</ha-switch> </ha-switch>
</ha-formfield> </ha-formfield>

View File

@ -104,7 +104,7 @@ class DialogSystemLogDetail extends LitElement {
)} )}
</ha-alert>` </ha-alert>`
: ""} : ""}
<div class="contents"> <div class="contents" tabindex="-1" dialogInitialFocus>
<p> <p>
Logger: ${item.name}<br /> Logger: ${item.name}<br />
Source: ${item.source.join(":")} Source: ${item.source.join(":")}
@ -227,6 +227,7 @@ class DialogSystemLogDetail extends LitElement {
} }
.contents { .contents {
padding: 16px; padding: 16px;
outline: none;
} }
.error { .error {
color: var(--error-color); color: var(--error-color);

View File

@ -111,6 +111,7 @@ export class DialogAddUser extends LitElement {
.errorMessage=${this.hass.localize("ui.common.error_required")} .errorMessage=${this.hass.localize("ui.common.error_required")}
@value-changed=${this._handleValueChanged} @value-changed=${this._handleValueChanged}
@blur=${this._maybePopulateUsername} @blur=${this._maybePopulateUsername}
dialogInitialFocus
></paper-input>` ></paper-input>`
: ""} : ""}
<paper-input <paper-input
@ -125,6 +126,7 @@ export class DialogAddUser extends LitElement {
autocapitalize="none" autocapitalize="none"
@value-changed=${this._handleValueChanged} @value-changed=${this._handleValueChanged}
.errorMessage=${this.hass.localize("ui.common.error_required")} .errorMessage=${this.hass.localize("ui.common.error_required")}
dialogInitialFocus
></paper-input> ></paper-input>
<paper-input <paper-input

View File

@ -65,6 +65,7 @@ export class DialogStatisticsFixUnitsChanged extends LitElement {
name="action" name="action"
.checked=${this._action === "update"} .checked=${this._action === "update"}
@change=${this._handleActionChanged} @change=${this._handleActionChanged}
dialogInitialFocus
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
<ha-formfield <ha-formfield

View File

@ -47,7 +47,11 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
${this._params.issue.data.supported_unit}? ${this._params.issue.data.supported_unit}?
</p> </p>
<mwc-button slot="primaryAction" @click=${this._fixIssue}> <mwc-button
slot="primaryAction"
@click=${this._fixIssue}
dialogInitialFocus
>
Fix Fix
</mwc-button> </mwc-button>
<mwc-button slot="secondaryAction" @click=${this.closeDialog}> <mwc-button slot="secondaryAction" @click=${this.closeDialog}>