Bug 1200322 - Fix a11y problem around key navigation in the urlbar. r=Mossop, a=ritu
authorDrew Willcoxon <adw@mozilla.com>
Tue, 01 Sep 2015 16:00:42 -0700
changeset 289078 39f3fb013387eda8eca493c9007d386968ff62b0
parent 289077 b8ea21b86a822ab6bbcf1260e35fdc7846f8c923
child 289079 549f54fa2333771c9bfef0c1359d6cf106f9697f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop, ritu
bugs1200322
milestone42.0a2
Bug 1200322 - Fix a11y problem around key navigation in the urlbar. r=Mossop, a=ritu
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -188,18 +188,19 @@ file, You can obtain one at http://mozil
 
       <method name="onKeyPress">
         <parameter name="aEvent"/>
         <body><![CDATA[
           switch (aEvent.keyCode) {
             case KeyEvent.DOM_VK_LEFT:
             case KeyEvent.DOM_VK_RIGHT:
             case KeyEvent.DOM_VK_HOME:
-              this.popup.hidePopup();
-              return;
+              // Reset the selected index so that nsAutoCompleteController
+              // simply closes the popup without trying to fill anything.
+              this.popup.selectedIndex = -1;
               break;
           }
 
           return this.handleKeyPress(aEvent);
         ]]></body>
       </method>
 
       <field name="_mayTrimURLs">true</field>