Skip to content

Commit bf977a6

Browse files
committed
Menu: Improve first and last methods to take non-menuitem items into account
1 parent d5df3a5 commit bf977a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ $.widget("ui.menu", {
155155
},
156156

157157
first: function() {
158-
return this.active && !this.active.prev().length;
158+
return this.active && !this.active.prevAll(".ui-menu-item").length;
159159
},
160160

161161
last: function() {
162-
return this.active && !this.active.next().length;
162+
return this.active && !this.active.nextAll(".ui-menu-item").length;
163163
},
164164

165165
_move: function(direction, edge, event) {

0 commit comments

Comments
 (0)