-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not showing hints when number of hints equals (limit - rendered) #1299
Comments
I think this is a significant bug, assume you set the limit to 15. You get 9 items from remote. The slice of 15-9 is 6, so only the first 6 will be used. Like what? 👎 |
Yeah, a real problem. But switching those two lines of code to append first and only then increase the number of rendered hints solves it. |
@jharding can we make a quick bug fix release with this? |
Oh, shit! This bug have waste whole my afternoon... |
fix the bug for the issue twitter/typeahead.js#1299
fix the issue for twitter/typeahead.js#1299
Merging into src files the changes suggested in issue twitter#1299. When suggestions length equals the limit, no data was shown, as slice was asked to cut zero elements. The bug also caused strange behavior when suggestion's length is higher than limit, as negative indexes were introduced.
This issue was not merged into the source files. |
The problem is that twitter/typeahead is no longer maintained. I too fixed this bug - see #1416 - but there is a very long queue of pull requests. The new active project is https://github.com/corejavascript/typeahead.js |
Oh! I though about that! but didn't find any notice about that! |
macgyver solution is not correct, but it works = D |
Whatever you're trying to fix or work around has probably already been On 31 October 2015 at 13:19, AdmirTomaz notifications@github.com wrote:
|
No, I tested this, I saw that you had posted above, the js are the same as I had here, it is the same way |
Sorry, didn't realise it was the same thread. |
if they find a better solution, please let here. =D |
The corejs fork has updated it in master, but they haven't pushed up a new version yet so if you do a straight bower install you'll get the same behavior. See: corejavascript/typeahead.js@a52bd45 |
Hi guys! Is it resolved already? |
When getting remote hints, if the number of hints equals (limit - rendered) since in typeahead.bundle.js line 1723 it runs:
So if the number of hints equals (limit - rendered) then it'll append an empty array (suggestions.slice(0, 0)). To prevent this just switch those two lines so that it first appends the suggestions and only then increases the number of rendered hints:
The text was updated successfully, but these errors were encountered: