File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ $.widget( "ui.selectmenu", {
56
56
} ,
57
57
58
58
_drawButton : function ( ) {
59
- var tabindex = this . element . attr ( "tabindex" ) ;
59
+ var that = this ,
60
+ tabindex = this . element . attr ( "tabindex" ) ;
60
61
61
62
// Associate existing label with the new button
62
63
this . label = $ ( "label[for='" + this . ids . element + "']" ) . attr ( "for" , this . ids . button ) ;
@@ -96,6 +97,10 @@ $.widget( "ui.selectmenu", {
96
97
this . _setOption ( "width" , this . options . width ) ;
97
98
98
99
this . _on ( this . button , this . _buttonEvents ) ;
100
+ this . button . one ( "focusin" , function ( ) {
101
+ // Delay rendering the menu items until the button receives focus
102
+ that . _refreshMenu ( ) ;
103
+ } ) ;
99
104
this . _hoverable ( this . button ) ;
100
105
this . _focusable ( this . button ) ;
101
106
} ,
@@ -329,13 +334,6 @@ $.widget( "ui.selectmenu", {
329
334
} ,
330
335
331
336
_buttonEvents : {
332
- focusin : function ( ) {
333
- // Delay rendering the menu items until the button receives focus
334
- if ( ! this . menuItems ) {
335
- this . _refreshMenu ( ) ;
336
- }
337
- this . _off ( this . button , "focusin" ) ;
338
- } ,
339
337
click : "_toggle" ,
340
338
keydown : function ( event ) {
341
339
var preventDefault = true ;
You can’t perform that action at this time.
0 commit comments