mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 00:36:34 +00:00
♿ close card editor on ESC (#4570)
This commit is contained in:
parent
fc4e3e90b2
commit
9aedeab4fa
@ -86,7 +86,7 @@ export class HuiDialogEditCard extends LitElement {
|
||||
}
|
||||
|
||||
return html`
|
||||
<ha-paper-dialog with-backdrop opened modal>
|
||||
<ha-paper-dialog with-backdrop opened modal @keyup=${this._handleKeyUp}>
|
||||
<h2>
|
||||
${heading}
|
||||
</h2>
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user