From 0b751a9dd6e0bc71b4577ddeaf1d2b74581f5df5 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 13 Feb 2019 12:48:05 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02011=20-=20Fix=20search=20auto-completio?= =?UTF-8?q?n=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.autocomplete.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/jquery.autocomplete.js b/js/jquery.autocomplete.js index 3c5e3efe3..ad65f5d16 100644 --- a/js/jquery.autocomplete.js +++ b/js/jquery.autocomplete.js @@ -384,7 +384,7 @@ success(term,parsed); } // if an AJAX url has been supplied, try loading the data now - } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + } else if( (typeof options.url == "string") && (options.url.length > 0) && (term.length > 0) ){ var extraParams = { timestamp: +new Date() @@ -479,7 +479,7 @@ minChars: 1, delay: 400, matchCase: false, - matchSubset: true, + matchSubset: false, matchContains: false, cacheLength: 100, max: 1000, @@ -640,7 +640,10 @@ }); } } - return csub; + if ( csub.length > 0 ) { + return csub; + } + return null; } else // if the exact item exists, use it if (data[q]){