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