I have the below code using Typeahead.js for suggestions. I have no major issues on the code as it works fine.
The minor issue I face is that any given time, I see only 5 suggestions even though there are more than 5 suggestions from the remote URL.
var isearch = new Bloodhound({
datumTokenizer: function(d) {
return Bloodhound.tokenizers.whitespace(d.value);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: "http://localhost/search/get-data/%QUERY"
});
isearch.initialize();
$("#search_box .typeahead").typeahead(null,{ name: "isearch",
displayKey: "value",
source: isearch.ttAdapter(),
templates: {
suggestion: Handlebars.compile("{{value}}")
}
});
What I expect is that there are more suggestions, there should be a scroll bar for users to see.