File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11621162 // hide the search box if this is the first we got the results and there are a few of them
11631163
11641164 if ( initial === true ) {
1165+ // TODO below we use data.results.length, but what we really need is something recursive to calc the length
1166+ // TODO in case there are optgroups
11651167 showSearchInput = this . showSearchInput = data . results . length >= this . opts . minimumResultsForSearch ;
1166- this . container . find ( ".select2-search" ) [ showSearchInput ? "removeClass" : "addClass" ] ( "select2-search-hidden" ) ;
1168+ this . dropdown . find ( ".select2-search" ) [ showSearchInput ? "removeClass" : "addClass" ] ( "select2-search-hidden" ) ;
11671169
11681170 //add "select2-with-searchbox" to the container if search box is shown
1169- this . container [ showSearchInput ? "addClass" : "removeClass" ] ( "select2-with-searchbox" ) ;
1171+ $ ( this . dropdown , this . container ) [ showSearchInput ? "addClass" : "removeClass" ] ( "select2-with-searchbox" ) ;
11701172 }
11711173
11721174 } ,
You can’t perform that action at this time.
0 commit comments