mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-25 22:27:39 +00:00
update findBestHint function
solve the "Cannot read property 'toLowerCase' of undefined" issue with findBestHint function when suggestion.value doesn't exist
This commit is contained in:
parent
608d9efaa6
commit
9b98ccc7ef
4
dist/jquery.autocomplete.min.js
vendored
4
dist/jquery.autocomplete.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "devbridge-autocomplete",
|
"name": "devbridge-autocomplete",
|
||||||
"version": "1.4.11",
|
"version": "1.4.12",
|
||||||
"description": "Autocomplete provides suggestions while you type into the text field.",
|
"description": "Autocomplete provides suggestions while you type into the text field.",
|
||||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||||
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
||||||
|
@ -761,9 +761,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.each(that.suggestions, function (i, suggestion) {
|
$.each(that.suggestions, function (i, suggestion) {
|
||||||
var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
|
var foundMatch = false;
|
||||||
if (foundMatch) {
|
if (suggestion.value !== undefined) {
|
||||||
bestMatch = suggestion;
|
foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
|
||||||
|
if (foundMatch) {
|
||||||
|
bestMatch = suggestion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return !foundMatch;
|
return !foundMatch;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user