File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 959959 this . close ( ) ;
960960 this . container . removeClass ( "select2-container-active" ) ;
961961 this . dropdown . removeClass ( "select2-drop-active" ) ;
962+ if ( this . search . is ( ":focus" ) ) { this . search . blur ( ) ; }
962963 this . clearSearch ( ) ;
963964 this . selection . find ( ".select2-search-choice-focus" ) . removeClass ( "select2-search-choice-focus" ) ;
964965 } ,
13171318 // TODO validate placeholder is a string if specified
13181319
13191320 if ( opts . element . get ( 0 ) . tagName . toLowerCase ( ) === "select" ) {
1320- // install sthe selection initializer
1321+ // install the selection initializer
13211322 opts . initSelection = function ( element ) {
13221323 var data = [ ] ;
13231324 element . find ( ":selected" ) . each2 ( function ( i , elm ) {
14541455 var placeholder = this . getPlaceholder ( ) ;
14551456
14561457 if ( placeholder !== undefined && this . getVal ( ) . length === 0 && this . search . hasClass ( "select2-focused" ) === false ) {
1457-
14581458 this . search . val ( placeholder ) . addClass ( "select2-default" ) ;
14591459 // stretch the search box to full width of the container so as much of the placeholder is visible as possible
14601460 this . search . width ( this . getContainerWidth ( ) ) ;
You can’t perform that action at this time.
0 commit comments