diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 1391643ba..3f010c1f4 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -433,11 +433,11 @@ $.widget("ui.menu", { }, first: function() { - return this.active && !this.active.prev().length; + return this.active && !this.active.prevAll(".ui-menu-item").length; }, last: function() { - return this.active && !this.active.next().length; + return this.active && !this.active.nextAll(".ui-menu-item").length; }, move: function(direction, edge, event) {