[autocomplete] Suggested modification to moveSelect()

[autocomplete] Suggested modification to moveSelect()


I've been working with the autocomplete widget to create a categorized
list of choices -- similar to an optgroup in a select element. I bound
a function to the autocompleteshow event to add the categories to the
list, but ran into some problems with the scrolling behavior when
using the arrow keys.
I dug into the source, and found that on line 621 (of the 1.6rc2
code), replacing:
listItems.slice(0, active).each(...
with:
activeItem.prevAll().each(...
makes the scroll behavior work correctly even when other elements have
been added to the list.
I ran some quick timing tests, and over 50 calls with each method, the
average call time for moveSelect() was 3.881ms using slice() and
4.633ms using prevAll().
-Matt