Bug 1502576 - The search bar's popup should not open when clicking menu items in its context menu. r=mkaply
authorDrew Willcoxon <adw@mozilla.com>
Mon, 26 Nov 2018 18:11:50 +0000
changeset 507356 eaa26fe663cb2b4ab2a6c6da22b50f8595742092
parent 507355 9dcdb35839c5b2ea345118d2c109682ee1fb0831
child 507357 38acc9df8e69e5c2377ba2f6d6c8bc6665a5dbef
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkaply
bugs1502576
milestone65.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 1502576 - The search bar's popup should not open when clicking menu items in its context menu. r=mkaply Differential Revision: https://phabricator.services.mozilla.com/D12374
browser/components/search/content/searchbar.js
--- a/browser/components/search/content/searchbar.js
+++ b/browser/components/search/content/searchbar.js
@@ -459,16 +459,21 @@ class MozSearchbar extends MozXULElement
         return;
       }
 
       // Ignore clicks on the search go button.
       if (event.originalTarget.classList.contains("search-go-button")) {
         return;
       }
 
+      // Ignore clicks on menu items in the input's context menu.
+      if (event.originalTarget.localName == "menuitem") {
+        return;
+      }
+
       let isIconClick = event.originalTarget.classList.contains("searchbar-search-button");
 
       // Ignore clicks on the icon if they were made to close the popup
       if (isIconClick && this._clickClosedPopup) {
         return;
       }
 
       // Open the suggestions whenever clicking on the search icon or if there