Dismiss dialog if the user clicks outside it or hit the escape button (#6741)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Joakim Sørensen 2020-08-30 09:42:58 +02:00 committed by GitHub
parent d8e88bc58d
commit 78a1e45be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -90,7 +90,14 @@ export class DialogHassioNetwork extends LitElement implements HassDialog {
} }
return html` return html`
<ha-dialog open .heading=${true} hideActions @closed=${this.closeDialog}> <ha-dialog
open
scrimClickAction
escapeKeyAction
.heading=${true}
hideActions
@closed=${this.closeDialog}
>
<div slot="heading"> <div slot="heading">
<ha-header-bar> <ha-header-bar>
<span slot="title"> <span slot="title">

View File

@ -55,9 +55,9 @@ class DialogBox extends LitElement {
return html` return html`
<ha-dialog <ha-dialog
open open
scrimClickAction ?scrimClickAction=${this._params.prompt}
escapeKeyAction ?escapeKeyAction=${this._params.prompt}
@close=${this._close} @closed=${this._dismiss}
.heading=${this._params.title .heading=${this._params.title
? this._params.title ? this._params.title
: this._params.confirmation && : this._params.confirmation &&