Autocompletion Sorting in Firefox 3

Jun 16, 2008

I recently noted in Firefox 3.0 RC 2 that the sort order for autocompleting input fields is broken. In Firefox 2.x, items are sorted alphabetically (different from the insertion order scheme used in Firefox 1.x, if I recall correctly). Now, it appears that the items are sorted according to how they were inserted, with the most recent entries appearing on the bottom. This strange result unfortunately affects Googlebar Lite, beginning with Firefox 3 builds. I haven't received any complaints about this at the moment, but I'm guessing that most people haven't switched away from 2.x, so no one has caught it yet.

It's possible that this issue is a valid Firefox bug. I see that bug 418343 has been written against the search autocomplete results, though I'm guessing it applies to all autocompleting elements (with the exception of the AwesomeBar).

The autocomplete textbox inherits the sortDirection property from the base XUL element, but I have yet to try setting that manually to see if it has any effect. And I'm not sure whether to set it on the textbox itself, or on one of the child elements that lives inside.

Hopefully setting this property will fix the issue, though I'm only given three sort options: ascending, descending, and natural. I'm guessing that the natural option is what I'm seeing now in Firefox 3, with newest at the bottom. One of the largest feature requests that I get for Googlebar Lite is to sort search history items in the order they were inserted, with newest at the top. While I may not be able to easily sort things like people want, I might at least be able to return to the behavior seen in 2.x.

1 Comment

Marko

10:38 AM on Feb 4, 2009
Thanks, this was very helpful!

Leave a Comment

Ignore this field:
Never displayed
Leave this blank:
Optional; will not be indexed
Ignore this field:
Both Markdown and a limited set of HTML tags are supported
Leave this empty: