@@ -79,10 +79,6 @@ return $.widget( "ui.selectmenu", {
7979
8080 this . _rendered = false ;
8181 this . menuItems = $ ( ) ;
82-
83- if ( this . options . disabled ) {
84- this . disable ( ) ;
85- }
8682 } ,
8783
8884 _drawButton : function ( ) {
@@ -563,24 +559,30 @@ return $.widget( "ui.selectmenu", {
563559 }
564560
565561 if ( key === "disabled" ) {
566- this . menuInstance . option ( "disabled" , value ) ;
567- this . button . attr ( "aria-disabled" , value ) ;
568- this . _toggleClass ( this . button , null , "ui-state-disabled" , value ) ;
569-
570- this . element . prop ( "disabled" , value ) ;
571- if ( value ) {
572- this . button . attr ( "tabindex" , - 1 ) ;
573- this . close ( ) ;
574- } else {
575- this . button . attr ( "tabindex" , 0 ) ;
576- }
562+ this . _setOptionDisabled ( value ) ;
577563 }
578564
579565 if ( key === "width" ) {
580566 this . _resizeButton ( ) ;
581567 }
582568 } ,
583569
570+ _setOptionDisabled : function ( value ) {
571+ this . _super ( value ) ;
572+
573+ this . menuInstance . option ( "disabled" , value ) ;
574+ this . button . attr ( "aria-disabled" , value ) ;
575+ this . _toggleClass ( this . button , null , "ui-state-disabled" , value ) ;
576+
577+ this . element . prop ( "disabled" , value ) ;
578+ if ( value ) {
579+ this . button . attr ( "tabindex" , - 1 ) ;
580+ this . close ( ) ;
581+ } else {
582+ this . button . attr ( "tabindex" , 0 ) ;
583+ }
584+ } ,
585+
584586 _appendTo : function ( ) {
585587 var element = this . options . appendTo ;
586588
0 commit comments