1
0
mirror of synced 2024-11-25 22:36:03 +03:00

Avoid error on empty search result in MultiSelect

This fixes https://github.com/select2/select2/issues/2942.
This commit is contained in:
Daniel Vinntreus 2015-01-19 13:20:54 +01:00 committed by Kevin Brown
parent 2eea4a486a
commit 95e6f80619

View File

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