Bug 563777 - Awesomebar refuses to scroll down when moving the selection using the Down key; it jumps back although selection stays [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Thu, 13 May 2010 13:45:23 -0400
changeset 66221 c210aa346df6f872f6fe80ae7d1effafed4ba54a
parent 66220 22b668c106dd4fffe88ecc4b56631e6e4e665195
child 66222 2218a91228b7bc0e6f0944d24a23b53efeeb372f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs563777
Bug 563777 - Awesomebar refuses to scroll down when moving the selection using the Down key; it jumps back although selection stays [r=mbrubeck]
mobile/chrome/content/bindings.xml
--- a/mobile/chrome/content/bindings.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -32,21 +32,16 @@
       <handler event="keypress" keycode="VK_RETURN" phase="capturing">
         <![CDATA[
           if (this.popup.allBookmarksItemSelected) {
             this.popup.closePopup();
             CommandUpdater.doCommand("cmd_bookmarks");
           }
         ]]>
       </handler>
-      <handler event="input">
-        <![CDATA[
-          this.popup.scrollToTop();
-        ]]>
-      </handler>
     </handlers>
   </binding>
 
   <binding id="popup_autocomplete_result">
     <content orient="vertical">
       <xul:hbox class="autocomplete-item-label" align="top" xbl:inherits="tags, favorite" mousethrough="always">
         <xul:image xbl:inherits="src"/>
         <xul:vbox flex="1">
@@ -179,22 +174,16 @@
             return;
 
           this.selectedIndex = -1;
           this.input.controller.stopSearch();
 
           this.collapsed = true;
           this._popupOpen = false;
 
-          // Scroll to the top left for the next open (only if necessary).
-          // Doing this now rather than in open() turns out to be faster,
-          // possibly because it avoids scrolling too soon after we uncollapse
-          // ourselves
-          this.scrollToTop();
-
           let event = document.createEvent("Events");
           event.initEvent("popuphidden", true, false);
           this.dispatchEvent(event);
 
           BrowserUI.showToolbar(false);
           BrowserUI.popDialog();
         ]]></body>
       </method>
@@ -280,16 +269,19 @@
           }
 
           // Show the "no results" or "all bookmarks" entries as needed
           this._updateNoResultsItem(matchCount);
           if (searchString == "") {
             items.insertBefore(this._allBookmarksItem, items.firstChild);
             this._allBookmarksItem._hidden = false;
           }
+
+          // Make sure the list is scrolled to the top
+          this.scrollToTop();
         ]]></body>
       </method>
 
       <method name="_updateNoResultsItem">
         <parameter name="isResults" />
         <body><![CDATA[
           let noResultsItem = this._items.childNodes.item(1);
           if (isResults) {