Bug 1546147 - fix broken search keyword textbox when switching categories, r=vporof
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 24 Apr 2019 17:32:16 +0000
changeset 529515 d7ee53a44d58872b07253d70aa4f0adf6ba89759
parent 529514 4ec3f8bab9f32fbcbe04dfda2aa32f8a59389d37
child 529516 505d9ce41e464450f39affec12d52866dac39890
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvporof
bugs1546147
milestone68.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 1546147 - fix broken search keyword textbox when switching categories, r=vporof Differential Revision: https://phabricator.services.mozilla.com/D28674
browser/components/preferences/in-content/search.js
toolkit/content/widgets/tree.js
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -233,17 +233,17 @@ var gSearchPane = {
       case "select":
         if (aEvent.target.id == "engineList") {
           gSearchPane.onTreeSelect();
         }
         break;
       case "blur":
         if (aEvent.target.id == "engineList" &&
             aEvent.target.inputField == document.getBindingParent(aEvent.originalTarget)) {
-          gSearchPane.onInputBlur();
+          gSearchPane.onInputBlur(aEvent);
         }
         break;
     }
   },
 
   observe(aEngine, aTopic, aVerb) {
     if (aTopic == "browser-search-engine-modified") {
       aEngine.QueryInterface(Ci.nsISearchEngine);
--- a/toolkit/content/widgets/tree.js
+++ b/toolkit/content/widgets/tree.js
@@ -1142,17 +1142,18 @@
         return;
 
       var input = this.inputField;
       var editingRow = this._editingRow;
       var editingColumn = this._editingColumn;
       this._editingRow = -1;
       this._editingColumn = null;
 
-      if (accept) {
+      // `this.view` could be null if the tree was hidden before we were called.
+      if (accept && this.view) {
         var value = input.value;
         this.view.setCellText(editingRow, editingColumn, value);
       }
       input.hidden = true;
       input.value = "";
       this.removeAttribute("editing");
     }