LeaVerou / awesomplete

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.

Home Page:http://leaverou.github.io/awesomplete/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doulbe lists of items

opened this issue · comments

in reference to this discussion #17208 I have solved, for the moment, reloading the page and then resetting all the lists of Awesome. As I was asked I proceeded to create a codepen https://codepen.io/CaneRandagio/pen/QWjydBO in the js code there are instructions for recreating the problem. Thanks to the availability

Perfect, providing a Codepen makes it MUCH easier to assist. I spotted your issue immediately!

Every time popola() is called it does another new Awesomplete(). You're creating multiple Awesomplete instances on the same input. Instead you should do something like.
const textboxAwesomplete = new Awesomplete(textbox, {list:items});

and when you want to update
textboxAwesomplete.list(newListOfItems)

ok. Thanks