File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,9 @@ $.widget( "ui.menubar", {
168
168
clearTimeout ( that . closeTimer ) ;
169
169
}
170
170
} ) ;
171
+
172
+ // Keep track of open submenus
173
+ this . openSubmenus = 0 ;
171
174
} ,
172
175
173
176
_destroy : function ( ) {
@@ -218,6 +221,7 @@ $.widget( "ui.menubar", {
218
221
. removeAttr ( "tabIndex" ) ;
219
222
this . active = null ;
220
223
this . open = false ;
224
+ this . openSubmenus = 0 ;
221
225
} ,
222
226
223
227
_open : function ( event , menu ) {
@@ -255,10 +259,22 @@ $.widget( "ui.menubar", {
255
259
} ,
256
260
257
261
next : function ( event ) {
262
+ if ( this . open && this . active . data ( "menu" ) . active . has ( ".ui-menu" ) . length ) {
263
+ // Track number of open submenus and prevent moving to next menubar item
264
+ this . openSubmenus ++ ;
265
+ return ;
266
+ }
267
+ this . openSubmenus = 0 ;
258
268
this . _move ( "next" , "first" , event ) ;
259
269
} ,
260
270
261
271
previous : function ( event ) {
272
+ if ( this . open && this . openSubmenus ) {
273
+ // Track number of open submenus and prevent moving to previous menubar item
274
+ this . openSubmenus -- ;
275
+ return ;
276
+ }
277
+ this . openSubmenus = 0 ;
262
278
this . _move ( "prev" , "last" , event ) ;
263
279
} ,
264
280
You can’t perform that action at this time.
0 commit comments