Bug 488357 - Item in location bar drop down highlighted after clicking same one on previous location bar usage. r=gavin

This commit is contained in:
Dão Gottwald 2009-04-20 00:51:38 +02:00
parent bfc64d95e1
commit b39ca36e34
2 changed files with 4 additions and 8 deletions

View File

@ -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 @@
<![CDATA[
if (!this.mPopupOpen) {
this.mInput = aInput;
// clear any previous selection, see bugs 400671 and 488357
this.selectedIndex = -1;
document.popupNode = null;
var rect = aElement.getBoundingClientRect();
var width = rect.right - rect.left;
var width = aElement.getBoundingClientRect().width;
this.setAttribute("width", width > 100 ? width : 100);
// invalidate() depends on the width attribute
this._invalidate();

View File

@ -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;