File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -763,21 +763,24 @@ the specific language governing permissions and limitations under the Apache Lic
763763
764764 // abstract
765765 destroy : function ( ) {
766- var select2 = this . opts . element . data ( "select2" ) ;
766+ var element = this . opts . element , select2 = element . data ( "select2" ) ;
767767
768768 if ( this . propertyObserver ) { delete this . propertyObserver ; this . propertyObserver = null ; }
769769
770770 if ( select2 !== undefined ) {
771-
772771 select2 . container . remove ( ) ;
773772 select2 . dropdown . remove ( ) ;
774- select2 . opts . element
773+ element
775774 . removeClass ( "select2-offscreen" )
776775 . removeData ( "select2" )
777776 . off ( ".select2" )
778- . attr ( { "tabindex" : this . elementTabIndex } )
779- . prop ( "autofocus" , this . autofocus || false )
780- . show ( ) ;
777+ . prop ( "autofocus" , this . autofocus || false ) ;
778+ if ( this . elementTabIndex ) {
779+ element . attr ( { tabindex : this . elementTabIndex } ) ;
780+ } else {
781+ element . removeAttr ( "tabindex" ) ;
782+ }
783+ element . show ( ) ;
781784 }
782785 } ,
783786
You can’t perform that action at this time.
0 commit comments