Comments (11)
This may be the issue
from typeahead.js.
Could be, but the code seems pretty different from what is in that bug report, and I don't pretend to understand what it's supposed to be doing.
Here's what I think is the current code:
function async(suggestions) {
suggestions = suggestions || [];
if (!canceled && rendered < that.limit) {
that.cancel = $.noop;
that._append(query, suggestions.slice(0, that.limit - rendered));
rendered += suggestions.length;
that.async && that.trigger("asyncReceived", query);
}
}
In the bug it refers to code that should be:
var idx = (that.limit > rendered) ? rendered : that.limit;
that._append(query, suggestions.slice(0, idx));
Would love a fix for this. It's a pretty wonky problem.
from typeahead.js.
replace that._append with the two lines suggested and that fixed it for me.
from typeahead.js.
Thanks @mwjackson. I tried that, but when I put those two lines in place, I couldn't get back any results at all, no matter how many results the backend returned.
from typeahead.js.
This is how my async function looks:
function async(suggestions) {
suggestions = suggestions || [];
if (!canceled && rendered < that.limit) {
that.cancel = $.noop;
rendered += suggestions.length;
var idx = (that.limit > rendered) ? rendered : that.limit;
that._append(query, suggestions.slice(0, idx));
that.async && that.trigger("asyncReceived", query);
}
}
from typeahead.js.
Yes! That fixed it! What should we do to get this change checked in? Are you a committer?
from typeahead.js.
No... just commit it to a branch and submit a PR
On 11 Jan 2016 21:10, "Mike Lissner" [email protected] wrote:
Yes! That fixed it! What should we do to get this change checked in? Are
you a committer?—
Reply to this email directly or view it on GitHub
#43 (comment)
.
from typeahead.js.
@mwjackson do you want to be a committer?
@lenovouser is the owner and seems open to giving people privileges
from typeahead.js.
OK, Pull Request created. I'm hopeful we can get this released quickly. It's a pretty major issue unless I'm mistaken.
from typeahead.js.
This has been merged! Closing.
from typeahead.js.
Tracking this for release soon, see #55
from typeahead.js.
Related Issues (20)
- Offset option is not working HOT 1
- Preventing http request base on custom characters or data types HOT 1
- Use with ES6 import HOT 3
- Show suggestions on focus with minLength=0 does not work
- Suggestions are not showing correctly
- Cursor being set on hover causes incorrect selection depending on mouse position
- Accessibility: Select box has no description
- Accessibility: Missing required WAI-ARIA states or properties HOT 1
- Right click results to open in new tabs
- Confusing name (Typeahead.js or corejs-typeahead?) HOT 6
- Can't replicate remote example with Django supplying JSON / don't know how to debug HOT 2
- Bad html syntax
- Limit on async requests when using more than six data sources HOT 1
- Error calculating rendered variable in async function. Succesive calls to this funcion not appending the suggestions:
- "async" call in custom "source" function not working as expected
- Vulnerabilties - JQuery 1.12.4 found when running lighthouse for optimization suggestion HOT 1
- onChange fires before value is updated [When Clicked]
- Any chance of removing jQuery dependency? HOT 1
- New release to npm? HOT 9
- Firefox is broken, Chrome and Edge works fine. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeahead.js.