Bug 1169704 - In-content preferences - Search tab - "One-click search engines" table remains highlighted after clicking elsewhere on the page, r=jaws
authorFischer.json <fischer.json@gmail.com>
Tue, 26 Jul 2016 18:12:42 +0800
changeset 347128 90b49d2b01334dd107bcbea8f0790dc518344fe2
parent 347127 ad4e4ea6550a47c0034608ab9fe038eca8be44d6
child 347129 e82080019746478198c4009ba0c5c358be3f0359
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1169704
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1169704 - In-content preferences - Search tab - "One-click search engines" table remains highlighted after clicking elsewhere on the page, r=jaws MozReview-Commit-ID: 2Tbzr0wSpv1
browser/components/preferences/in-content/search.js
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -101,16 +101,28 @@ var gSearchPane = {
       if (e.name == currentEngine)
         list.selectedItem = item;
     });
   },
 
   handleEvent: function(aEvent) {
     switch (aEvent.type) {
       case "click":
+        if (aEvent.target.id != "engineChildren" && aEvent.target.id != "removeEngineButton") {
+          let engineList = document.getElementById("engineList");
+          // We don't want to toggle off selection while editing keyword
+          // so proceed only when the input field is hidden
+          if (engineList.inputField.hidden) {
+            let selection = engineList.view.selection;
+            if (selection.count > 0) {
+              selection.toggleSelect(selection.currentIndex);
+            }
+            engineList.blur();
+          }
+        }
         if (aEvent.target.id == "addEngines" && aEvent.button == 0) {
           Services.wm.getMostRecentWindow('navigator:browser')
                      .BrowserSearch.loadAddEngines();
         }
         break;
       case "command":
         switch (aEvent.target.id) {
           case "":