From 5b08eec813e3fe73c9387e9d84d9e8f85ea2904a Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 23 Mar 2023 14:15:14 -0400 Subject: [PATCH] fx-compat: Don't run command handler when popup is opened --- chrome/content/zotero/elements/splitMenuButton.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/elements/splitMenuButton.js b/chrome/content/zotero/elements/splitMenuButton.js index 1159d9db3e..08f2280492 100644 --- a/chrome/content/zotero/elements/splitMenuButton.js +++ b/chrome/content/zotero/elements/splitMenuButton.js @@ -44,7 +44,7 @@ // the popup if over the end side of the button this.addEventListener('mousedown', (event) => { let rect = this.querySelector('[anonid="dropmarker-box"]').getBoundingClientRect(); - if (event.x >= rect.left && event.x <= rect.right + if ((!Zotero.rtl && event.clientX >= rect.left || Zotero.rtl && event.clientX <= rect.right) && Zotero.Utilities.Internal.showNativeElementPopup(this)) { event.preventDefault(); } @@ -83,7 +83,8 @@ _handleClick() { super._handleClick(); - if (!this.disabled) { + let popup = this.querySelector(':scope > menupopup'); + if (!this.disabled && (!popup || popup.state == 'closed')) { this.doCommand(); } }