Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: context menu doesn't close when clicking in editor

thecodrr53ec201d43d0
diff --git a/apps/web/src/utils/useContextMenu.js b/apps/web/src/utils/useContextMenu.js
index b053e6975..1435d6ff3 100644
--- a/apps/web/src/utils/useContextMenu.js
+++ b/apps/web/src/utils/useContextMenu.js
@@ -12,6 +12,7 @@ function closeMenu() {
);
window.removeEventListener("click", onWindowClick);
window.removeEventListener("keydown", onKeyDown);
+ window.removeEventListener("blur", onWindowClick);
}
function getGlobalMenu() {
@@ -23,6 +24,7 @@ function onKeyDown(event) {
}
function onWindowClick() {
+ console.log("WINDOW CLICK!");
closeMenu();
}
@@ -64,6 +66,7 @@ function openMenu(e) {
window.addEventListener("keydown", onKeyDown);
window.addEventListener("click", onWindowClick);
+ window.addEventListener("blur", onWindowClick);
}
function getPosition(e) {