File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -184,12 +184,6 @@ $.widget( "ui.selectmenu", {
184
184
} ,
185
185
186
186
open : function ( event ) {
187
- // init menu when initial opened
188
- if ( ! this . wasOpen ) {
189
- this . refresh ( ) ;
190
- this . wasOpen = true ;
191
- }
192
-
193
187
var currentItem = this . _getSelectedItem ( ) ;
194
188
195
189
if ( ! this . options . disabled ) {
@@ -284,11 +278,6 @@ $.widget( "ui.selectmenu", {
284
278
} ,
285
279
286
280
_move : function ( direction , event ) {
287
- // init menu when not done yet
288
- if ( ! this . wasOpen ) {
289
- this . refresh ( ) ;
290
- this . wasOpen = true ;
291
- }
292
281
if ( direction == "first" || direction == "last" ) {
293
282
// set focus manually for first or last item
294
283
this . menu . menu ( "focus" , event , this . menu . find ( "li" ) . not ( '.ui-selectmenu-optgroup' ) [ direction ] ( ) ) ;
@@ -320,6 +309,11 @@ $.widget( "ui.selectmenu", {
320
309
} ,
321
310
322
311
_buttonEvents : {
312
+ // init Menu on first focus
313
+ focus : function ( event ) {
314
+ this . refresh ( ) ;
315
+ this . button . unbind ( "focus." + this . widgetName )
316
+ } ,
323
317
click : function ( event ) {
324
318
this . _toggle ( event ) ;
325
319
event . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments