From a5cdd8d5aa39ed3e357956baa190c42368cfa4b8 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Thu, 31 Jul 2025 13:03:01 +0200 Subject: [PATCH] Fix context menu closes on every third right-click. Resolve #5427 --- chrome/content/zotero/customElements.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/customElements.js b/chrome/content/zotero/customElements.js index 8dfdac902e..00058fdd27 100644 --- a/chrome/content/zotero/customElements.js +++ b/chrome/content/zotero/customElements.js @@ -218,7 +218,7 @@ Services.scriptloader.loadSubScript('chrome://zotero/content/elements/itemTreeMe e.stopPropagation(); this.setAttribute("animate", "cancel"); // Make the timeout slightly longer than the animation duration (180ms) in _menupopup.scss - setTimeout(() => { + this._fadeTimeout = setTimeout(() => { this.removeAttribute("animate"); this.hidePopup(); }, 200); @@ -231,6 +231,7 @@ Services.scriptloader.loadSubScript('chrome://zotero/content/elements/itemTreeMe if (this !== e.target || this.parentNode?.closest("menupopup")) { return; } + clearTimeout(this._fadeTimeout); this.setAttribute("aria-hidden", true); setTimeout(() => { this.removeAttribute("aria-hidden");