From a28dff7525e8dc1a62463355bc1d0d4804f58be8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 28 Dec 2024 10:35:10 +0200 Subject: [PATCH] fix(client): drop down no longer hiding when it should --- src/public/app/menus/context_menu.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/public/app/menus/context_menu.ts b/src/public/app/menus/context_menu.ts index e765728e7..b5c53beaf 100644 --- a/src/public/app/menus/context_menu.ts +++ b/src/public/app/menus/context_menu.ts @@ -46,9 +46,9 @@ class ContextMenu { this.isMobile = utils.isMobile(); if (this.isMobile) { - this.$cover.on("click", this.hide); + this.$cover.on("click", () => this.hide()); } else { - $(document).on('click', (e) => this.hide); + $(document).on('click', (e) => this.hide()); } } @@ -218,7 +218,6 @@ class ContextMenu { // this date checking comes from change in FF66 - https://github.com/zadam/trilium/issues/468 // "contextmenu" event also triggers "click" event which depending on the timing can close the just opened context menu // we might filter out right clicks, but then it's better if even right clicks close the context menu - console.warn(new Error()); if (Date.now() - this.dateContextMenuOpenedMs > 300) { // seems like if we hide the menu immediately, some clicks can get propagated to the underlying component // see https://github.com/zadam/trilium/pull/3805 for details