Skip to content
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

Fixing bug when suggestions length is less than the limit #1501

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lukebergen
Copy link

A bug occurs when the number of suggestions is less than the limit.
Before, async update would give back suggestions.slice(0, limit - rendered) but in cases where number of rendered suggestions is less
than limit, this would result in missing suggestions.

e.g. Say the limit is 5 and the list of suggestions for my query "foo"
comes back as ["food", "fool", "foot"], this would result in appending
["food", "fool", "foot"].splice(0, 5 - 3) //=> ["food", "fool"] which
is missing the legitimate suggestion "foot".

Also in setting this up locally I scratched my head for a bit before figuring out that I needed to install Bower and run bower install. Updated the README to include those instructions.

A bug occurs when the number of suggestions is less than the limit.
Before, async update would give back `suggestions.slice(0, limit -
rendered)` but in cases where number of rendered suggestions is less
than limit, this would result in missing suggestions.

e.g. Say the limit is 5 and the list of suggestions for my query "foo"
comes back as ["food", "fool", "foot"], this would result in appending
`["food", "fool", "foot"].splice(0, 5 - 3) //=> ["food", "fool"]` which
is missing the legitimate suggestion "foot".
@lukebergen
Copy link
Author

Oops, I did not see #1485 and #1451 when I put this together or I'd have just upvoted their PRs. Shall I close this in favor of one of those two?

@jlbooker
Copy link
Contributor

Duplicate of #1212 - This project seems to unmaintained. Try the fork at: https://github.com/corejavascript/typeahead.js

@CLAassistant
Copy link

CLAassistant commented Jul 18, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants