From 8754752264fb8c3ca8bfca50db781aed75b3bce1 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Tue, 6 Apr 2021 14:19:27 +0000 Subject: [PATCH] Bug 1702125 - Only automatically add/remove open state on buttons on anchored arrowpanel events. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D110812 --- toolkit/content/widgets/panel.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/toolkit/content/widgets/panel.js b/toolkit/content/widgets/panel.js index 6810a966866d..c5eca2c3f1dd 100644 --- a/toolkit/content/widgets/panel.js +++ b/toolkit/content/widgets/panel.js @@ -202,13 +202,13 @@ if (this.isArrowPanel && event.target == this) { this.removeAttribute("animating"); this.setAttribute("panelopen", "true"); - } - if (this.isAnchored && this.anchorNode) { - let anchorRoot = - this.anchorNode.closest("toolbarbutton, .anchor-root") || - this.anchorNode; - anchorRoot.setAttribute("open", "true"); + if (this.isAnchored && this.anchorNode) { + let anchorRoot = + this.anchorNode.closest("toolbarbutton, .anchor-root") || + this.anchorNode; + anchorRoot.setAttribute("open", "true"); + } } // Fire event for accessibility APIs @@ -229,13 +229,13 @@ } else if (animate) { this.setAttribute("animate", "cancel"); } - } - if (this.isAnchored && this.anchorNode) { - let anchorRoot = - this.anchorNode.closest("toolbarbutton, .anchor-root") || - this.anchorNode; - anchorRoot.removeAttribute("open"); + if (this.isAnchored && this.anchorNode) { + let anchorRoot = + this.anchorNode.closest("toolbarbutton, .anchor-root") || + this.anchorNode; + anchorRoot.removeAttribute("open"); + } } try {