I checked lookupFilter
in their library and below is the code:
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
},
Here they are returning the value bascially if it is present in the results.
-1
means the letter a
is not found, so they're returning the value at any occurrence.
So just tune it as:
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
return suggestion.value.toLowerCase().indexOf(queryLowerCase) === 0;
},
Exactly at 0th index.
This will return the results with a
as first occurance.