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:
parent
f382f3d02d
commit
285abff24d
@ -1834,6 +1834,7 @@ 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>");
|
||||||
|
this.showSearch(search.val());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user