Bug 452080, autocomplete panel flickers on mobile because it hardcodes a panel height, instead don't resize when a height is specified, r=gavin
Bug 452080, autocomplete panel flickers on mobile because it hardcodes a panel height, instead don't resize when a height is specified, r=gavin
--- 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;