Bug 1316863 - stop manually closing the search popup to solve issues that seem to not exist anymore, r?nhnt11,florian
MozReview-Commit-ID: 3lcONwqYEFc
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -969,32 +969,35 @@
return;
}
// Check for middle-click or modified clicks on the search bar
if (popupForSearchBar) {
// Handle search bar popup clicks
var search = controller.getValueAt(this.selectedIndex);
- // close the autocomplete popup and revert the entered search term
- this.closePopup();
- controller.handleEscape();
-
// open the search results according to the clicking subtlety
var where = whereToOpenLink(aEvent, false, true);
let params = {};
// But open ctrl/cmd clicks on autocomplete items in a new background tab.
let modifier = this.AppConstants.platform == "macosx" ?
aEvent.metaKey :
aEvent.ctrlKey;
if (where == "tab" && (aEvent instanceof MouseEvent) &&
(aEvent.button == 1 || modifier))
params.inBackground = true;
+ // leave the popup open for background tab loads
+ if (!(where == "tab" && params.inBackground)) {
+ // close the autocomplete popup and revert the entered search term
+ this.closePopup();
+ controller.handleEscape();
+ }
+
searchBar.doSearch(search, where, null, params);
if (where == "tab" && params.inBackground)
searchBar.focus();
else
searchBar.value = search;
}
]]></body>
</method>
@@ -2222,24 +2225,16 @@
return; // ignore right clicks.
let button = event.originalTarget;
let engine = button.engine || button.parentNode.engine;
if (!engine)
return;
- // For some reason, if the context menu had been opened prior to the
- // click, the suggestions popup won't be closed after loading the search
- // in the current tab - so we hide it manually. Some focusing magic
- // that happens when a search is loaded ensures that the popup is opened
- // again if it needs to be, so we don't need to worry about which cases
- // require manual hiding.
- this.popup.hidePopup();
-
// Select the clicked button so that consumers can easily tell which
// button was acted on.
this.selectedButton = button;
this.handleSearchCommand(event, engine);
]]></handler>
<handler event="command"><![CDATA[
let target = event.originalTarget;