From 285abff24d999d599119f19c4d78473ebc5f7a46 Mon Sep 17 00:00:00 2001 From: Ludovic Montel Date: Tue, 25 Nov 2014 16:48:03 +0100 Subject: [PATCH] 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. --- select2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/select2.js b/select2.js index cb08670b..7c918e99 100644 --- a/select2.js +++ b/select2.js @@ -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("
  • " + evaluate(opts.formatNoMatches, opts.element, search.val()) + "
  • "); + this.showSearch(search.val()); return; }