File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,13 @@ $.widget( "ui.selectmenu", {
149
149
// adjust menu styles to dropdown
150
150
this . menu . addClass ( "ui-corner-bottom" ) . removeClass ( "ui-corner-all" ) ;
151
151
152
- // Make sure focus stays on selected item
153
- this . menuInstance . delay = 999999999 ;
154
152
// Unbind uneeded Menu events
155
153
this . menuInstance . _off ( this . menu , "mouseleave" ) ;
154
+
155
+ // Cancel the menu's collapseAll on document click
156
+ this . menuInstance . _closeOnDocumentClick = function ( ) {
157
+ return false ;
158
+ } ;
156
159
} ,
157
160
158
161
refresh : function ( ) {
@@ -185,9 +188,13 @@ $.widget( "ui.selectmenu", {
185
188
if ( this . options . disabled ) {
186
189
return ;
187
190
}
191
+
188
192
// Support: IE6-IE9 click doesn't trigger focus on the button
189
193
if ( ! this . menuItems ) {
190
194
this . refresh ( ) ;
195
+ } else {
196
+ this . menu . find ( ".ui-state-focus" ) . removeClass ( "ui-state-focus" ) ;
197
+ this . menu . menu ( "focus" , null , this . _getSelectedItem ( ) ) ;
191
198
}
192
199
193
200
this . isOpen = true ;
@@ -198,7 +205,7 @@ $.widget( "ui.selectmenu", {
198
205
199
206
this . _trigger ( "open" , event ) ;
200
207
} ,
201
-
208
+
202
209
_position : function ( ) {
203
210
this . menuWrap . position ( $ . extend ( { of : this . button } , this . options . position ) ) ;
204
211
} ,
You can’t perform that action at this time.
0 commit comments