feat(geomap): dismiss adding with escape

This commit is contained in:
Elian Doran 2025-01-21 21:03:27 +02:00
parent c2cb07ed08
commit be4ee4c173
No known key found for this signature in database

View File

@ -258,6 +258,14 @@ export default class GeoMapTypeWidget extends TypeWidget {
this.state = State.NewNote;
this.#adjustCursor();
const globalKeyListener: (this: Window, ev: KeyboardEvent) => any = (e) => {
this.state = State.Normal;
this.#adjustCursor();
window.removeEventListener("keydown", globalKeyListener);
};
window.addEventListener("keydown", globalKeyListener);
}
async doRefresh(note: FNote) {