Browse Source

Hide search box if select is empty

Fix #2282.
When a select box is empty (this appends in my case, I have a dynamic select box), the search box should not be shown.
Ludovic Montel 10 years ago
parent
commit
285abff24d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      select2.js

+ 1 - 0
select2.js

@@ -1834,6 +1834,7 @@ the specific language governing permissions and limitations under the Apache Lic
 
                 if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
                     render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>");
+                    this.showSearch(search.val());
                     return;
                 }