diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index cbcf86f8347f..3f47cefe9fd6 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -877,11 +877,6 @@ var controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController); controller.stopSearch(); - // when the popup hides, we need to clear the selection - // otherwise we will use the value of the selected index when the - // user hits enter. - // see bug #400671 for details - this.selectedIndex = -1; this.mPopupOpen = false; // Reset the maxRows property to the cached "normal" value, and reset @@ -953,10 +948,11 @@ 100 ? width : 100); // invalidate() depends on the width attribute this._invalidate(); diff --git a/toolkit/content/widgets/listbox.xml b/toolkit/content/widgets/listbox.xml index 5b0082b1816c..63ef676f93ef 100644 --- a/toolkit/content/widgets/listbox.xml +++ b/toolkit/content/widgets/listbox.xml @@ -398,7 +398,7 @@ for (var i = this.selectedItems.length - 1; i >= 0; --i) this.selectedItems[i].selected = false; - this.selectedItems.splice(0, this.selectedItems.length); + this.selectedItems.length = 0; } this._selectionStart = null;