You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loading options for the taglist component via an API call instead of assigning them directly.
The sample code of the Loading options section in the documentation returns an empty array when no search query is provided:
if (!search) return [];
For my use case, I always want to return a list of options, even if no query has been provided (yet).
When clicking on the taglist input to open the option list, this works fine the first time. But when clicking away to close the options list (without typing or selecting anything) the taglist executes a 'search' request on close and appends the results to the existing options. Effectively duplicating the options list every time the input is closed.
I've provided an example in the reproduction link. Simply click on the input field (one option will show), click away, and click again (option is duplicated). More duplicate options are added every time you repeat this step.
Reproduction
https://formkit.link/1439704f7483844193e5b340a36a0caf
Describe the bug
I'm loading options for the taglist component via an API call instead of assigning them directly.
The sample code of the Loading options section in the documentation returns an empty array when no search query is provided:
if (!search) return [];
For my use case, I always want to return a list of options, even if no query has been provided (yet).
When clicking on the taglist input to open the option list, this works fine the first time. But when clicking away to close the options list (without typing or selecting anything) the taglist executes a 'search' request on close and appends the results to the existing options. Effectively duplicating the options list every time the input is closed.
I've provided an example in the reproduction link. Simply click on the input field (one option will show), click away, and click again (option is duplicated). More duplicate options are added every time you repeat this step.
Environment
• OS: [e.g. iOS]
• Browser [e.g. chrome, safari]
• Version [e.g. 22]
The text was updated successfully, but these errors were encountered: