Bug 873429 - Be sure to dismiss form autocomplete popup when there are no suggestions. r=mfinkle, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 21 May 2013 13:32:10 -0700
changeset 142715 a6ec7be9af2cedf63c3cf8a6d044c299030bc090
parent 142714 66a6991a31461d96ce65380ab269240713a59ff6
child 142716 bca5f2d861523a849133785660abb7a632e352b3
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lsblakk
bugs873429
milestone23.0a2
Bug 873429 - Be sure to dismiss form autocomplete popup when there are no suggestions. r=mfinkle, a=lsblakk
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4810,17 +4810,17 @@ var FormAssistant = {
         currentElement = aEvent.target;
 
         // Since we can only show one popup at a time, prioritze autocomplete
         // suggestions over a form validation message
         let checkResultsInput = hasResults => {
           if (hasResults)
             return;
 
-          if (!this._showValidationMessage(currentElement))
+          if (this._showValidationMessage(currentElement))
             return;
 
           // If we're not showing autocomplete suggestions, hide the form assist popup
           this._hideFormAssistPopup();
         };
 
         this._showAutoCompleteSuggestions(currentElement, checkResultsInput);
         break;
@@ -4859,18 +4859,18 @@ var FormAssistant = {
         let value = results.getValueAt(i);
 
         // Do not show the value if it is the current one in the input field
         if (value == aSearchString)
           continue;
 
         // Supply a label and value, since they can differ for datalist suggestions
         suggestions.push({ label: value, value: value });
-        aCallback(suggestions);
       }
+      aCallback(suggestions);
     };
 
     this._formAutoCompleteService.autoCompleteSearchAsync(aElement.name || aElement.id,
                                                           aSearchString, aElement, null,
                                                           resultsAvailable);
   },
 
   /**