yuku / textcomplete

Autocomplete for HTMLTextAreaElement and more.
https://yuku.takahashi.coffee/textcomplete/
MIT License
1.74k stars 305 forks source link

Dynamically created text areas #336

Closed TfTHacker closed 3 years ago

TfTHacker commented 3 years ago

Thank you for such a useful library. I am working on an app that has dynamically generated text areas that come and go. Can you recommend a good way to manage textcomplete instances? Basically every time a text area is created, I will dynamically add textcomplete, and then when the textarea is destroyed will have to get rid of the textcomplete instance.

I wondered if there was a best practice or even something in the library for optimizing for this scenario?

yuku commented 3 years ago

Sorry for my late reply and thank you for using this library. There is nothing special for the situation. Please create a textcomplete object when a textarea is dynamically created, and destroy it immediately after removing the textarea.