Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set initial focus for some more dialogs #11676

Merged
merged 6 commits into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
.checked=${!this._disableNewEntities}
@change=${this._disableNewEntitiesChanged}
.disabled=${this._submitting}
dialogInitialFocus
></ha-switch>
</ha-formfield>
${this._allowUpdatePolling()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class DialogMQTTDeviceDebugInfo extends LitElement {
<ha-switch
.checked=${this._showDeserialized}
@change=${this._showDeserializedChanged}
dialogInitialFocus
>
</ha-switch>
</ha-formfield>
Expand Down
3 changes: 2 additions & 1 deletion src/panels/config/logs/dialog-system-log-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DialogSystemLogDetail extends LitElement {
)}
</ha-alert>`
: ""}
<div class="contents">
<div class="contents" tabindex="-1" dialogInitialFocus>
steverep marked this conversation as resolved.
Show resolved Hide resolved
<p>
Logger: ${item.name}<br />
Source: ${item.source.join(":")}
Expand Down Expand Up @@ -227,6 +227,7 @@ class DialogSystemLogDetail extends LitElement {
}
.contents {
padding: 16px;
outline: none;
}
.error {
color: var(--error-color);
Expand Down
2 changes: 2 additions & 0 deletions src/panels/config/users/dialog-add-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class DialogAddUser extends LitElement {
.errorMessage=${this.hass.localize("ui.common.error_required")}
@value-changed=${this._handleValueChanged}
@blur=${this._maybePopulateUsername}
dialogInitialFocus
></paper-input>`
: ""}
<paper-input
Expand All @@ -125,6 +126,7 @@ export class DialogAddUser extends LitElement {
autocapitalize="none"
@value-changed=${this._handleValueChanged}
.errorMessage=${this.hass.localize("ui.common.error_required")}
dialogInitialFocus
></paper-input>

<paper-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class DialogStatisticsFixUnitsChanged extends LitElement {
name="action"
.checked=${this._action === "update"}
@change=${this._handleActionChanged}
dialogInitialFocus
></ha-radio>
</ha-formfield>
<ha-formfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
${this._params.issue.data.supported_unit}?
</p>

<mwc-button slot="primaryAction" @click=${this._fixIssue}>
<mwc-button
slot="primaryAction"
@click=${this._fixIssue}
dialogInitialFocus
>
Fix
</mwc-button>
<mwc-button slot="secondaryAction" @click=${this.closeDialog}>
Expand Down