yairEO / tagify

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue
https://yaireo.github.io/tagify/
Other
3.48k stars 429 forks source link

Callback when original tag data has loaded #1330

Closed gitgitwhat closed 4 months ago

gitgitwhat commented 4 months ago

When you set the input value or textarea with tag data, it would be nice if there was a callback when that data has been completely processed and turned into tags. The issue I'm running into is on Javascript heavy pages and with inputs that get preloaded with a lot of dynamic tags, the JSON string value placed inside of the value is shown until the Tagify processing is complete. See the images below. First one shows what I see when the page is loading and the second is when Tagify is complete.

tag1 tag2

My thought is to initially hide the input control and then when Tagify is complete, unhide the control. But without a "loaded" callback, that won't work.

yairEO commented 4 months ago

you can add the hidden attribute to your input fields:

<input value='...' hidden />

You can also simply solve this with CSS by hiding the inputs