mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-12-22 10:58:55 +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",
|
||||
"version": "1.4.11",
|
||||
"version": "1.4.12",
|
||||
"description": "Autocomplete provides suggestions while you type into the text field.",
|
||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
||||
|
@ -761,9 +761,12 @@
|
||||
}
|
||||
|
||||
$.each(that.suggestions, function (i, suggestion) {
|
||||
var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
|
||||
if (foundMatch) {
|
||||
bestMatch = suggestion;
|
||||
var foundMatch = false;
|
||||
if (suggestion.value !== undefined) {
|
||||
foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
|
||||
if (foundMatch) {
|
||||
bestMatch = suggestion;
|
||||
}
|
||||
}
|
||||
return !foundMatch;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user