Fix closing and reopening a *native* menu too quickly causes it to be closed again

This commit is contained in:
windingwind 2023-12-16 19:18:03 +08:00 committed by Dan Stillman
parent 2a16c3c161
commit f5f475f738

View file

@ -102,7 +102,11 @@ Services.scriptloader.loadSubScript('chrome://zotero/content/elements/annotation
// Update animate attribute when the popup is hiding and trigger the fade out animation
this.addEventListener("popuphiding", (e) => {
if (!this.getAttribute("animate") || ["false", "false-once"].includes(this.getAttribute("animate"))) {
if (
// open="true" and aria-hidden="true" means it's a native menupopup
(this.getAttribute("open", "true") && this.getAttribute("aria-hidden", "true"))
|| !this.getAttribute("animate")
|| ["false", "false-once"].includes(this.getAttribute("animate"))) {
return;
}
e.preventDefault();