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

fix #1314 - limit doesn't work properly with more than one digit #1319

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PierreAnctil
Copy link

the suggestions where sliced with:
rendered += suggestions.length;
suggestions.slice(0, that.limit - rendered)

which is fine as long as limit < suggestions.length because slicing with a negative index works
but if limit = suggestions.length then no element is rendered.
if limit > suggestions.length then the results are truncated.

the suggestions where sliced with:
   rendered += suggestions.length;
   suggestions.slice(0, that.limit - rendered)

which is fine as long as  limit < suggestions.length  because slicing with a negative index works
but if limit = suggestions.length then no element is rendered.
if limit > suggestions.length then the results are truncated.
@ksykulev
Copy link

I just ran into the same issue. If limit == suggestions it shows no results.
suggestions.slice(0, 0) -> [] :(

@dougaxe1 dougaxe1 mentioned this pull request Jul 31, 2015
elemoine added a commit to Geoportail-Luxembourg/geoportailv3 that referenced this pull request Aug 18, 2015
This sets an arbitrary large limit (50) on the "pois" dataset to work around twitter/typeahead.js#1319.
elemoine added a commit to Geoportail-Luxembourg/geoportailv3 that referenced this pull request Aug 18, 2015
This sets an arbitrary large limit (50) on the "pois" dataset to work around twitter/typeahead.js#1319.
elemoine added a commit to Geoportail-Luxembourg/geoportailv3 that referenced this pull request Sep 2, 2015
elemoine added a commit to Geoportail-Luxembourg/geoportailv3 that referenced this pull request Sep 3, 2015
@core-system-dev
Copy link

@PierreAnctil Could you please re-submit this PR to github:corejavascript/typeahead.js. This project pretty much has been abandoned, and we continue now on a new fork. For more information please see #1320

@jlbooker
Copy link
Contributor

jlbooker commented Oct 5, 2015

Looks like a duplicate of #1212, has been fixed over at corejavascript/typeahead.js#8

scips added a commit to RTBF/typeahead.js that referenced this pull request Jan 6, 2017
scips added a commit to RTBF/typeahead.js that referenced this pull request Jan 6, 2017
* fix suggestion length bug see: twitter#1319
@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.

6 participants