File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1356,8 +1356,6 @@ the specific language governing permissions and limitations under the Apache Lic
13561356 return ;
13571357 }
13581358
1359- search . addClass ( "select2-active" ) ;
1360-
13611359 function postRender ( ) {
13621360 results . scrollTop ( 0 ) ;
13631361 search . removeClass ( "select2-active" ) ;
@@ -1386,9 +1384,6 @@ the specific language governing permissions and limitations under the Apache Lic
13861384 }
13871385 return ;
13881386 }
1389- else if ( opts . formatSearching ( ) && initial === true ) {
1390- render ( "<li class='select2-searching'>" + opts . formatSearching ( ) + "</li>" ) ;
1391- }
13921387
13931388 if ( opts . maximumInputLength && search . val ( ) . length > opts . maximumInputLength ) {
13941389 if ( checkFormatter ( opts . formatInputTooLong , "formatInputTooLong" ) ) {
@@ -1399,6 +1394,12 @@ the specific language governing permissions and limitations under the Apache Lic
13991394 return ;
14001395 }
14011396
1397+ if ( opts . formatSearching && this . findHighlightableChoices ( ) . length === 0 ) {
1398+ render ( "<li class='select2-searching'>" + opts . formatSearching ( ) + "</li>" ) ;
1399+ }
1400+
1401+ search . addClass ( "select2-active" ) ;
1402+
14021403 // give the tokenizer a chance to pre-process the input
14031404 input = this . tokenize ( ) ;
14041405 if ( input != undefined && input != null ) {
You can’t perform that action at this time.
0 commit comments