Bug 1397731 - Clear Preferences search query after category switchover. r=mconley, a=lizzard
authorRicky Chien <ricky060709@gmail.com>
Mon, 11 Sep 2017 23:33:10 +0800
changeset 421716 b0f08e34f67d602245dae02dc534bf9aee2ba7fd
parent 421715 8850107a6a8b5e124c86a2e1bedbcc4f01ac43f9
child 421717 577b2db694a7812dd737c4e18283119c53277630
push id7754
push userryanvm@gmail.com
push dateWed, 13 Sep 2017 22:07:59 +0000
treeherdermozilla-beta@b0f08e34f67d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, lizzard
bugs1397731
milestone56.0
Bug 1397731 - Clear Preferences search query after category switchover. r=mconley, a=lizzard MozReview-Commit-ID: DoV5xHW0xKP
browser/components/preferences/in-content-new/preferences.js
--- a/browser/components/preferences/in-content-new/preferences.js
+++ b/browser/components/preferences/in-content-new/preferences.js
@@ -156,16 +156,17 @@ function gotoPref(aCategory) {
   // Subcategories allow for selecting smaller sections of the preferences
   // until proper search support is enabled (bug 1353954).
   let subcategory = breakIndex != -1 && category.substring(breakIndex + 1);
   if (subcategory) {
     category = category.substring(0, breakIndex);
   }
   category = friendlyPrefCategoryNameToInternalName(category);
   if (category != "paneSearchResults") {
+    gSearchResultsPane.query = null;
     gSearchResultsPane.searchInput.value = "";
     gSearchResultsPane.getFindSelection(window).removeAllRanges();
     gSearchResultsPane.removeAllSearchTooltips();
     gSearchResultsPane.removeAllSearchMenuitemIndicators();
   } else if (!gSearchResultsPane.searchInput.value) {
     // Something tried to send us to the search results pane without
     // a query string. Default to the General pane instead.
     category = kDefaultCategoryInternalName;