Skip to content

Build your personal knowledge base with Trilium Notes

fix(geomap): dismissing add with any key

Elian Doran65553250b507
diff --git a/src/public/app/widgets/type_widgets/geo_map.ts b/src/public/app/widgets/type_widgets/geo_map.ts
index 406cd6e004..d5157301d5 100644
--- a/src/public/app/widgets/type_widgets/geo_map.ts
+++ b/src/public/app/widgets/type_widgets/geo_map.ts
@@ -265,6 +265,10 @@ export default class GeoMapTypeWidget extends TypeWidget {
this.#changeState(State.NewNote);
const globalKeyListener: (this: Window, ev: KeyboardEvent) => any = (e) => {
+ if (e.key !== "Escape") {
+ return;
+ }
+
this.#changeState(State.Normal);
window.removeEventListener("keydown", globalKeyListener);