Browse Source

show search if minimum input length has been set

Igor Vaynberg 12 years ago
parent
commit
bcfa3fc702
1 changed files with 2 additions and 1 deletions
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -1509,6 +1509,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 } else {
                 } else {
                     render("");
                     render("");
                 }
                 }
+                if (initial) this.showSearch(true);
                 return;
                 return;
             }
             }
 
 
@@ -2040,7 +2041,7 @@ the specific language governing permissions and limitations under the Apache Lic
 
 
             // show the search box if this is the first we got the results and there are enough of them for search
             // show the search box if this is the first we got the results and there are enough of them for search
 
 
-            if (initial === true) {
+            if (initial === true && this.showSearchInput === false) {
                 var min=this.opts.minimumResultsForSearch;
                 var min=this.opts.minimumResultsForSearch;
                 if (min>=0) {
                 if (min>=0) {
                     this.showSearch(countResults(data.results)>=min);
                     this.showSearch(countResults(data.results)>=min);