From 9c69f73de58b5b7ad8fb887fba265ba889ec2704 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 16 Jun 2022 17:33:28 -0500 Subject: [PATCH] Manually remove handler instead of using `once` Since we only want to remove if the target matches. --- chrome/content/zotero/elements/menuToolbarbutton.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/elements/menuToolbarbutton.js b/chrome/content/zotero/elements/menuToolbarbutton.js index 6ce3083d25..dea3ebda86 100644 --- a/chrome/content/zotero/elements/menuToolbarbutton.js +++ b/chrome/content/zotero/elements/menuToolbarbutton.js @@ -45,11 +45,13 @@ ); this.setAttribute('open', true); - popup.addEventListener('popuphiding', (event) => { + let handler = (event) => { if (event.target == popup) { this.setAttribute('open', false); + popup.removeEventListener('popuphiding', handler); } - }, { once: true }); + }; + popup.addEventListener('popuphiding', handler); } }); }