Skip to content
Snippets Groups Projects
Verified Commit 482e7648 authored by Edgar Chen's avatar Edgar Chen Committed by Pier Angelo Vendrame
Browse files

Bug 1909535 - Don't show select dropdown in background tabs; a=dmeehan

parent 859c6b11
Branches
Tags
1 merge request!1453TB 43587: Rebased legacy onto 115.22.0esr
......@@ -278,6 +278,31 @@ export var SelectParentHelper = {
},
open(browser, menulist, rect, isOpenedViaTouch, selectParentActor) {
const canOpen = (() => {
if (!menulist.ownerDocument.hasFocus()) {
// Don't open in inactive browser windows.
return false;
}
if (browser) {
if (!browser.browsingContext.isActive) {
// Don't open in inactive tabs.
return false;
}
let tabbrowser = browser.getTabBrowser();
if (tabbrowser && tabbrowser.selectedBrowser != browser) {
// AsyncTabSwitcher might delay activating our browser, check
// explicitly for tabbrowser.
return false;
}
}
return true;
})();
if (!canOpen) {
selectParentActor.sendAsyncMessage("Forms:DismissedDropDown", {});
return;
}
this._actor = selectParentActor;
menulist.hidden = false;
this._currentBrowser = browser;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment