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", {
5656 } ,
5757
5858 _drawButton : function ( ) {
59- var tabindex = this . element . attr ( "tabindex" ) ;
59+ var that = this ,
60+ tabindex = this . element . attr ( "tabindex" ) ;
6061
6162 // Associate existing label with the new button
6263 this . label = $ ( "label[for='" + this . ids . element + "']" ) . attr ( "for" , this . ids . button ) ;
@@ -96,6 +97,10 @@ $.widget( "ui.selectmenu", {
9697 this . _setOption ( "width" , this . options . width ) ;
9798
9899 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+ } ) ;
99104 this . _hoverable ( this . button ) ;
100105 this . _focusable ( this . button ) ;
101106 } ,
@@ -329,13 +334,6 @@ $.widget( "ui.selectmenu", {
329334 } ,
330335
331336 _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- } ,
339337 click : "_toggle" ,
340338 keydown : function ( event ) {
341339 var preventDefault = true ;
You can’t perform that action at this time.
0 commit comments