Giter Site home page Giter Site logo

Comments (6)

kaskar2008 avatar kaskar2008 commented on June 7, 2024 1

Hello, @tbl0605
Thanks for the reporting and such a deep dig into the bug :)

from vue-simple-suggest.

tbl0605 avatar tbl0605 commented on June 7, 2024 1

@kaskar2008, would it be possible to make a new release now that this patch is merged?
Thank you for you great work :)

from vue-simple-suggest.

tbl0605 avatar tbl0605 commented on June 7, 2024

I forgot to mention that I can reproduce this bug (at least) on latest versions of Chrome and Firefox :)

from vue-simple-suggest.

tbl0605 avatar tbl0605 commented on June 7, 2024

The issue disappears with my patch (I cannot reproduce the bug anymore).
But you should consider it as a partial fix or workaround, because there is a real deeper problem in your code (I haven't tracked it down), the value of "isPlainSuggestion" seems (sometimes) not to be in sync (or updated soon enough) to reflect latest values retrieved from method getSuggestions().
So my patch will "hide" the real problem but not completly fix it.

For example, before my patch, you could have :

  • "isPlainSuggestion" is set to true because getSuggestions() returned an empty array of values (setting it to true was buggy, my patch fixes that)
  • getSuggestions() is called again and returns a non-empty array of values BUT those list of suggestions is (wrongly) drawn with "isPlainSuggestion" still set to true

Hope I'm clear enough :)

from vue-simple-suggest.

tbl0605 avatar tbl0605 commented on June 7, 2024

My guess for the real problem is that multiple calls to "await this.list(value))" can be done in a very short time and those promises can resolve in any order when the server api is a bit laggy.
Probably getSuggestions() should return an object containing "isPlainSuggestion" and the list of suggestions, so that both would be synchronized and be updated at same time (and neither too early nor too late).

from vue-simple-suggest.

tbl0605 avatar tbl0605 commented on June 7, 2024

Hopefully last comment: I updated my patch so it can be taken as-is, without doing further code changes afterwards, even if I think that "isPlainSuggestion" should be updated outside of getSuggestions() at same time than this.$set(this, 'suggestions', newList)

from vue-simple-suggest.

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.