mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +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`
|
return html`
|
||||||
<ha-paper-dialog with-backdrop opened modal>
|
<ha-paper-dialog with-backdrop opened modal @keyup=${this._handleKeyUp}>
|
||||||
<h2>
|
<h2>
|
||||||
${heading}
|
${heading}
|
||||||
</h2>
|
</h2>
|
||||||
@ -264,6 +264,12 @@ export class HuiDialogEditCard extends LitElement {
|
|||||||
this._error = ev.detail.error;
|
this._error = ev.detail.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _handleKeyUp(ev: KeyboardEvent) {
|
||||||
|
if (ev.keyCode === 27) {
|
||||||
|
this._close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _close(): void {
|
private _close(): void {
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
this._cardConfig = undefined;
|
this._cardConfig = undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user