fx-compat: Don't run <split-menu-button> command handler when popup is opened

This commit is contained in:
Abe Jellinek 2023-03-23 14:15:14 -04:00
parent 8f87a74398
commit 5b08eec813

View file

@ -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();
}
}