Closed jorgepozas closed 9 years ago
I also was struggling with this. You can get around this by increasing the 'data-limit' attribute to a higher value than your serverside-limit + 5 (see https://github.com/sergeyt/meteor-typeahead/issues/74)
This bug was copied from the original twitter's typeahead.js library See here https://github.com/twitter/typeahead.js/issues/1354
First off, thanks for the great wrapper! As I've been using it more and more, I noticed an issue.
When getting back 4 results from server, and passing them into callback, only one ends up displayed in the suggestions. This is with a 5 suggestion limit.
I was looking through code and it seems like an issue in the async function, where suggestions are being sliced erroneously when appended. When running through the below code, rendered is initally equal to 0, suggestions.length =4, and that.limit = 5. The below code basically implies that suggestions should be sliced from 0 to (5-4 = 1) which means that only one suggestion is shown instead of all 4.
Am I missing something?
function async(suggestions) { ... rendered += suggestions.length; that._append(query, suggestions.slice(0, that.limit - rendered)); ... }