Bug 1457066 - Add consumeoutsideclicks attribute to menu popup. r?jdescottes
Popup manager will eat click event when clicking outside of popup only if macOS
and Linux. This patch will add consumeoutesideclicks attribute to this popup in
order to prevent to react click event listener of a button which accessing to
this popup on all platform.
MozReview-Commit-ID: Sv3Hv9Olhn
--- a/devtools/client/framework/menu.js
+++ b/devtools/client/framework/menu.js
@@ -71,16 +71,17 @@ Menu.prototype.popup = function(screenX,
// opening a new one.
let popup = popupset.querySelector("menupopup[menu-api=\"true\"]");
if (popup) {
popup.hidePopup();
}
popup = doc.createElement("menupopup");
popup.setAttribute("menu-api", "true");
+ popup.setAttribute("consumeoutsideclicks", "true");
if (this.id) {
popup.id = this.id;
}
this._createMenuItems(popup);
// Remove the menu from the DOM once it's hidden.
popup.addEventListener("popuphidden", (e) => {