From e871edc8f347e6add552abe67d94a68793558802 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 6 Apr 2023 23:05:03 +0200 Subject: [PATCH] fix click events propagating from context menu being closed, fixes #3805 --- src/public/app/menus/context_menu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/public/app/menus/context_menu.js b/src/public/app/menus/context_menu.js index 19b5f6433..c87127803 100644 --- a/src/public/app/menus/context_menu.js +++ b/src/public/app/menus/context_menu.js @@ -147,7 +147,9 @@ class ContextMenu { // "contextmenu" event also triggers "click" event which depending on the timing can close just opened context menu // we might filter out right clicks, but then it's better if even right clicks close the context menu if (Date.now() - this.dateContextMenuOpenedMs > 300) { - this.$widget.hide(); + // 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 + setTimeout(() => this.$widget.hide(), 100); } } }