File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,11 @@ $.widget( "ui.menu", {
77
77
mouseHandled = true ;
78
78
79
79
this . select ( event ) ;
80
- // Redirect focus to the menu
81
- if ( ! this . element . is ( ":focus" ) ) {
80
+ // Open submenu on click
81
+ if ( this . element . has ( ".ui-menu" ) . length ) {
82
+ this . expand ( event ) ;
83
+ } else if ( ! this . element . is ( ":focus" ) ) {
84
+ // Redirect focus to the menu
82
85
this . element . focus ( ) ;
83
86
}
84
87
}
@@ -584,7 +587,9 @@ $.widget( "ui.menu", {
584
587
// Selecting a menu item removes the active item causing multiple clicks to be missing an item
585
588
item : this . active || $ ( event . target ) . closest ( ".ui-menu-item" )
586
589
} ;
587
- this . collapseAll ( event , true ) ;
590
+ if ( ! ui . item . has ( ".ui-menu" ) . length ) {
591
+ this . collapseAll ( event , true ) ;
592
+ }
588
593
this . _trigger ( "select" , event , ui ) ;
589
594
}
590
595
} ) ;
You can’t perform that action at this time.
0 commit comments