Permalink
Browse files

Selectmenu: prevent widget from item looping

  • Loading branch information...
1 parent 2c9f5a8 commit ff1bb1457921daa339fdf66582842b9838387949 @fnagel fnagel committed Jul 1, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 ui/jquery.ui.selectmenu.js
@@ -270,6 +270,10 @@ $.widget( "ui.selectmenu", {
// Set focus manually for first or last item
this.menu.menu( "focus", event, this.menuItems[ direction ]() );
} else {
+ if ( direction === "previous" && this.menu.menu( "isFirstItem" ) || direction === "next" && this.menu.menu( "isLastItem" ) ) {
+ return;
+ }
+
// Move to and focus next or prev item
this.menu.menu( direction, event );
}

0 comments on commit ff1bb14

Please sign in to comment.