typeahead.js icon indicating copy to clipboard operation
typeahead.js copied to clipboard

typeahead does not show up if suggestions.length == typeahead.limit

Open eliasbaixas opened this issue 7 years ago • 8 comments

https://github.com/twitter/typeahead.js/blob/588440f66559714280628a4f9799f0c4eb880a4a/dist/typeahead.bundle.js#L1723

the addition of suggestions.length to the "rendered" variable, should be done AFTER appending the suggestions, that._append(query, suggestions.slice(0, that.limit - rendered));

because otherwise that.limit is equal to rendered, and NOTHING gets rendered (suggestions.slice(0,0) returns empty array)

eliasbaixas avatar Jan 17 '18 13:01 eliasbaixas

Just ran into the sampe problem... Solution for me: set limit: Number.MAX_SAFE_INTEGER and limit the amount to display in the backend!

StefanKern avatar Jan 25 '18 13:01 StefanKern

Related problem: if your limit is 5 and you have 3 suggestions, only 2 will show.
limit - suggestions = 2

abidingotter avatar Feb 07 '18 05:02 abidingotter

+1 bitten by this here.

luisabreu avatar Feb 26 '18 22:02 luisabreu

i solved this problem by the way. i have config option of type hit with limit always more number show in backend response . It worked perfect .

Jimmea avatar Mar 11 '18 04:03 Jimmea

Seems like #1672 should fix this.

phdesign avatar May 30 '18 05:05 phdesign

In case anyone finds this issue (like I did), this is fixed in the maintained fork https://github.com/corejavascript/typeahead.js

SanderVanLeeuwen avatar Dec 02 '20 11:12 SanderVanLeeuwen

Will this issue be fixed soon? It is still an issue.

JoshMayberry avatar May 26 '21 14:05 JoshMayberry

This looks like a duplicate of ticket #1324. It could be that https://github.com/corejavascript/typeahead.js/ solves this problem.

Chealer avatar Jul 30 '21 16:07 Chealer