Giter VIP home page Giter VIP logo

Comments (11)

mwjackson avatar mwjackson commented on June 8, 2024

This may be the issue

twitter/typeahead.js#1435

from typeahead.js.

mlissner avatar mlissner commented on June 8, 2024

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.

mwjackson avatar mwjackson commented on June 8, 2024

replace that._append with the two lines suggested and that fixed it for me.

from typeahead.js.

mlissner avatar mlissner commented on June 8, 2024

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.

mwjackson avatar mwjackson commented on June 8, 2024

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.

mlissner avatar mlissner commented on June 8, 2024

Yes! That fixed it! What should we do to get this change checked in? Are you a committer?

from typeahead.js.

mwjackson avatar mwjackson commented on June 8, 2024

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.

jcrben avatar jcrben commented on June 8, 2024

@mwjackson do you want to be a committer?

@lenovouser is the owner and seems open to giving people privileges

from typeahead.js.

mlissner avatar mlissner commented on June 8, 2024

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.

mlissner avatar mlissner commented on June 8, 2024

This has been merged! Closing.

from typeahead.js.

jlbooker avatar jlbooker commented on June 8, 2024

Tracking this for release soon, see #55

from typeahead.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.