From ff1bb1457921daa339fdf66582842b9838387949 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 1 Jul 2013 22:23:12 +0200 Subject: [PATCH] Selectmenu: prevent widget from item looping --- ui/jquery.ui.selectmenu.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index d58d4ff7b..464e94836 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/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 ); }