From 6a9c2caaf7a906d9dfd3639ab78ca1a7fc8002f0 Mon Sep 17 00:00:00 2001 From: Tomas Kirda Date: Thu, 27 Jun 2013 16:25:47 -0500 Subject: [PATCH] Exit if there is no value for hint. --- src/jquery.autocomplete.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 75a4fa6..cc4e4b1 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -507,6 +507,10 @@ value = that.el.val().toLowerCase(), bestMatch = null; + if (!value) { + return; + } + $.each(that.suggestions, function (i, suggestion) { var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0; if (foundMatch) {