mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Focus cancel button on destructive confirmation dialog (#19889)
This commit is contained in:
parent
bb25817bae
commit
b9935717dc
@ -89,7 +89,12 @@ class DialogBox extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
${confirmPrompt &&
|
${confirmPrompt &&
|
||||||
html`
|
html`
|
||||||
<mwc-button @click=${this._dismiss} slot="secondaryAction">
|
<mwc-button
|
||||||
|
@click=${this._dismiss}
|
||||||
|
slot="secondaryAction"
|
||||||
|
?dialogInitialFocus=${!this._params.prompt &&
|
||||||
|
this._params.destructive}
|
||||||
|
>
|
||||||
${this._params.dismissText
|
${this._params.dismissText
|
||||||
? this._params.dismissText
|
? this._params.dismissText
|
||||||
: this.hass.localize("ui.dialogs.generic.cancel")}
|
: this.hass.localize("ui.dialogs.generic.cancel")}
|
||||||
@ -97,7 +102,8 @@ class DialogBox extends LitElement {
|
|||||||
`}
|
`}
|
||||||
<mwc-button
|
<mwc-button
|
||||||
@click=${this._confirm}
|
@click=${this._confirm}
|
||||||
?dialogInitialFocus=${!this._params.prompt}
|
?dialogInitialFocus=${!this._params.prompt &&
|
||||||
|
!this._params.destructive}
|
||||||
slot="primaryAction"
|
slot="primaryAction"
|
||||||
class=${classMap({
|
class=${classMap({
|
||||||
destructive: this._params.destructive || false,
|
destructive: this._params.destructive || false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user