Fix exiting a submenu flashes the entire menu closed

This commit is contained in:
windingwind 2023-12-16 19:36:31 +08:00 committed by Dan Stillman
parent f5f475f738
commit 687a6c5091

View file

@ -103,8 +103,9 @@ 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 !== e.target
// open="true" and aria-hidden="true" means it's a native menupopup
(this.getAttribute("open", "true") && this.getAttribute("aria-hidden", "true"))
|| (this.getAttribute("open", "true") && this.getAttribute("aria-hidden", "true"))
|| !this.getAttribute("animate")
|| ["false", "false-once"].includes(this.getAttribute("animate"))) {
return;