1
0
mirror of synced 2024-11-22 04:56:08 +03:00

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.
This commit is contained in:
Ludovic Montel 2014-11-25 16:48:03 +01:00
parent f382f3d02d
commit 285abff24d

View File

@ -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;
}