File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -736,6 +736,10 @@ the specific language governing permissions and limitations under the Apache Lic
736736
737737 // Calculate size of scrollbar
738738 scrollBarDimensions = scrollBarDimensions || measureScrollbar ( ) ;
739+
740+ this . autofocus = opts . element . prop ( "autofocus" )
741+ opts . element . prop ( "autofocus" , false ) ;
742+ if ( this . autofocus ) this . focus ( ) ;
739743 } ,
740744
741745 // abstract
@@ -753,6 +757,7 @@ the specific language governing permissions and limitations under the Apache Lic
753757 . removeData ( "select2" )
754758 . unbind ( ".select2" )
755759 . attr ( { "tabindex" : this . elementTabIndex } )
760+ . prop ( "autofocus" , this . autofocus )
756761 . show ( ) ;
757762 }
758763 } ,
@@ -1886,6 +1891,7 @@ the specific language governing permissions and limitations under the Apache Lic
18861891 this . initContainerWidth ( ) ;
18871892 this . opts . element . addClass ( "select2-offscreen" ) ;
18881893 this . setPlaceholder ( ) ;
1894+
18891895 } ,
18901896
18911897 // single
You can’t perform that action at this time.
0 commit comments