Avoid error on empty search result in MultiSelect
This fixes https://github.com/select2/select2/issues/2942.
This commit is contained in:
parent
2eea4a486a
commit
95e6f80619
@ -1841,7 +1841,9 @@ 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());
|
||||
if(this.showSearch){
|
||||
this.showSearch(search.val());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user