Open ariademur opened 3 years ago
I think that's happening because of the document click listener, which always calls the function to close the results list, even if it's already closed.
I think a fairly easy solution would be to just add a check in that function to see if the results list is already open, and only close it if it is.
Thanks!
For my purposes I ended up using a custom modified version of your script, but I will follow the project closely and looking forward to updates, I think it's one for the best autocomplete systems currently available, good job!
Hello,
Using vanilla JS, I noticed that "onUpdate" is being called on any event on the page, not only when the results list is updated, as the documentation states.
Here's a Codepen example forked from "Simple autocomplete - @trevoreyre/autocomplete-js" https://codepen.io/ariademur/pen/wvoQErz
Even if clicking around the page, no relation to the autocomplete, the "onUpdate" is called.
If this is intentional, is there any other way to get the functionality specified in the documentation, a function that is executed when the results list is updated?
Thanks in advance.