]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: fixed #5347 - Autocomplete: each successive item hover makes item above...
authorRichard Worth <rdworth@gmail.com>
Mon, 15 Mar 2010 20:40:20 +0000 (20:40 +0000)
committerRichard Worth <rdworth@gmail.com>
Mon, 15 Mar 2010 20:40:20 +0000 (20:40 +0000)
ui/jquery.ui.autocomplete.js

index a6e50f3c3453b50137a31f863f6e7b6fad74eb17..ece6df4d5d5412efc56b02627f8a9726c97237da 100644 (file)
@@ -352,12 +352,6 @@ $.widget("ui.menu", {
 
        activate: function(item) {
                this.deactivate();
-               this.active = item.eq(0)
-                       .children("a")
-                               .addClass("ui-state-hover")
-                               .attr("id", "ui-active-menuitem")
-                       .end();
-               this._trigger("focus", null, { item: item });
                if (this.hasScroll()) {
                        var offset = item.offset().top - this.element.offset().top,
                                scroll = this.element.attr("scrollTop"),
@@ -368,6 +362,12 @@ $.widget("ui.menu", {
                                this.element.attr("scrollTop", scroll + offset - elementHeight + item.height());
                        }
                }
+               this.active = item.eq(0)
+                       .children("a")
+                               .addClass("ui-state-hover")
+                               .attr("id", "ui-active-menuitem")
+                       .end();
+               this._trigger("focus", null, { item: item });
        },
 
        deactivate: function() {