From 9aedeab4fa044e24aa04e6fc06220e2692b42c3d Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Thu, 23 Jan 2020 07:43:09 -0600 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=20close=20card=20editor=20on=20ESC=20?= =?UTF-8?q?(#4570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lovelace/editor/card-editor/hui-dialog-edit-card.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index e75a279163..379be4c30d 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -86,7 +86,7 @@ export class HuiDialogEditCard extends LitElement { } return html` - +

${heading}

@@ -264,6 +264,12 @@ export class HuiDialogEditCard extends LitElement { this._error = ev.detail.error; } + private _handleKeyUp(ev: KeyboardEvent) { + if (ev.keyCode === 27) { + this._close(); + } + } + private _close(): void { this._params = undefined; this._cardConfig = undefined;