Bug 452080, autocomplete panel flickers on mobile because it hardcodes a panel height, instead don't resize when a height is specified, r=gavin
authorNeil Deakin <neil@mozilla.com>
Sat, 13 Sep 2008 17:03:07 -0400
changeset 19221 766c9fb5942c96f10b2bb982a713b96844186219
parent 19220 b6c3d94c2f66c323648d5332ef7d7d53e147eedb
child 19222 1df65cbf518aee67c8ab9ccd8d78fa9d7707a42a
push id2031
push userneil@mozilla.com
push dateSat, 13 Sep 2008 21:04:26 +0000
treeherderautoland@766c9fb5942c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs452080
milestone1.9.1b1pre
Bug 452080, autocomplete panel flickers on mobile because it hardcodes a panel height, instead don't resize when a height is specified, r=gavin
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -983,23 +983,25 @@
           this._invalidate();
           ]]>
         </body>
       </method>
 
       <method name="_invalidate">
         <body>
           <![CDATA[
-          // collapsed if no matches
-          this.richlistbox.collapsed = (this._matchCount == 0);
+          if (!this.hasAttribute("height")) {
+            // collapsed if no matches
+            this.richlistbox.collapsed = (this._matchCount == 0);
 
-          // Dynamically update height until richlistbox.rows works (bug 401939)
-          // Adjust the height immediately and after the row contents update
-          this.adjustHeight();
-          setTimeout(function(self) self.adjustHeight(), 0, this);
+            // Dynamically update height until richlistbox.rows works (bug 401939)
+            // Adjust the height immediately and after the row contents update
+            this.adjustHeight();
+            setTimeout(function(self) self.adjustHeight(), 0, this);
+          }
 
           // make sure to collapse any existing richlistitems
           // that aren't going to be used
           var existingItemsCount = this.richlistbox.childNodes.length;
           for (var i = this._matchCount; i < existingItemsCount; i++)
             this.richlistbox.childNodes[i].collapsed = true;
 
           this._currentIndex = 0;