mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-29 00:06:36 +00:00
Validate is suggestions is undefined
This commit is contained in:
parent
05a337cba9
commit
dcaa358d12
30
dist/jquery.autocomplete.js
vendored
30
dist/jquery.autocomplete.js
vendored
@ -780,23 +780,29 @@
|
||||
var that = this,
|
||||
options = that.options;
|
||||
|
||||
result.suggestions = that.verifySuggestionsFormat(result.suggestions);
|
||||
// Validate if suggestions is undefined
|
||||
if (result.suggestions !== undefined) {
|
||||
result.suggestions = that.verifySuggestionsFormat(result.suggestions);
|
||||
|
||||
// Cache results if cache is not disabled:
|
||||
if (!options.noCache) {
|
||||
that.cachedResponse[cacheKey] = result;
|
||||
if (options.preventBadQueries && result.suggestions.length === 0) {
|
||||
that.badQueries.push(originalQuery);
|
||||
// Cache results if cache is not disabled:
|
||||
if (!options.noCache) {
|
||||
that.cachedResponse[cacheKey] = result;
|
||||
if (options.preventBadQueries && result.suggestions.length === 0) {
|
||||
that.badQueries.push(originalQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return if originalQuery is not matching current query:
|
||||
if (originalQuery !== that.getQuery(that.currentValue)) {
|
||||
// Return if originalQuery is not matching current query:
|
||||
if (originalQuery !== that.getQuery(that.currentValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
that.suggestions = result.suggestions;
|
||||
that.suggest();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
that.suggestions = result.suggestions;
|
||||
that.suggest();
|
||||
},
|
||||
|
||||
activate: function (index) {
|
||||
|
Loading…
Reference in New Issue
Block a user