Fix context menu closes on every third right-click. Resolve #5427

This commit is contained in:
Tom Najdek 2025-07-31 13:03:01 +02:00
parent 682722bc29
commit a5cdd8d5aa
No known key found for this signature in database
GPG key ID: EEC61A7B4C667D77

View file

@ -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");