mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: prevent widget from item looping
This commit is contained in:
parent
2c9f5a8c01
commit
ff1bb14579
4
ui/jquery.ui.selectmenu.js
vendored
4
ui/jquery.ui.selectmenu.js
vendored
@ -270,6 +270,10 @@ $.widget( "ui.selectmenu", {
|
|||||||
// Set focus manually for first or last item
|
// Set focus manually for first or last item
|
||||||
this.menu.menu( "focus", event, this.menuItems[ direction ]() );
|
this.menu.menu( "focus", event, this.menuItems[ direction ]() );
|
||||||
} else {
|
} else {
|
||||||
|
if ( direction === "previous" && this.menu.menu( "isFirstItem" ) || direction === "next" && this.menu.menu( "isLastItem" ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Move to and focus next or prev item
|
// Move to and focus next or prev item
|
||||||
this.menu.menu( direction, event );
|
this.menu.menu( direction, event );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user