2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-25 14:17:45 +00:00

Fixed when empty query added as bad query

There was an issue when empty query was ran but no result given, the code did not even try to query result when empty search did not give results.
This commit is contained in:
Tamás 2022-12-25 22:15:28 +01:00 committed by GitHub
parent 8138252b4c
commit 35d1299735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -819,7 +819,7 @@
// Cache results if cache is not disabled:
if (!options.noCache) {
that.cachedResponse[cacheKey] = result;
if (options.preventBadQueries && !result.suggestions.length) {
if (options.preventBadQueries && !result.suggestions.length && originalQuery) {
that.badQueries.push(originalQuery);
}
}