Skip to content

Commit 901d525

Browse files
committed
Add close button when not confirmation/alert dialog
1 parent 254bac8 commit 901d525

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/dialogs/generic/dialog-box.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mdiAlertOutline } from "@mdi/js";
1+
import { mdiAlertOutline, mdiClose } from "@mdi/js";
22
import { css, html, LitElement, nothing } from "lit";
33
import { customElement, property, query, state } from "lit/decorators";
44
import { ifDefined } from "lit/directives/if-defined";
@@ -70,6 +70,15 @@ class DialogBox extends LitElement {
7070
aria-describedby="dialog-box-description"
7171
>
7272
<ha-dialog-header slot="header">
73+
${!confirmPrompt
74+
? html`<slot name="headerNavigationIcon" slot="navigationIcon">
75+
<ha-icon-button
76+
data-dialog="close"
77+
.label=${this.hass?.localize("ui.common.close") ?? "Close"}
78+
.path=${mdiClose}
79+
></ha-icon-button
80+
></slot>`
81+
: nothing}
7382
<span slot="title" id="dialog-box-title">
7483
${this._params.warning
7584
? html`<ha-svg-icon

0 commit comments

Comments
 (0)