JaleelB / emblor

A fully-featured tag input component built with shadcn/ui
https://emblor.jaleelbennett.com
MIT License
542 stars 24 forks source link

Autocomplete feature not working properly #7

Closed eliza921 closed 6 months ago

eliza921 commented 6 months ago

I've noticed that the autocomplete is not working properly. After the second character input, all the options disappear. I've been trying to debug this issue, but so far, I haven't had any luck in identifying the root cause.

Any guidance or suggestions would be greatly appreciated.

Despite this issue, I find the tool very useful and appreciate the effort put into developing it. Thanks a lot.

eliza921 commented 6 months ago

Apparently, this has fixed it!

-<CommandItem key={uuid()} className={`py-0 ${maxTags !== undefined && tags.length >= maxTags ? "cursor-not-allowed" : "cursor-pointer"}}>
+<CommandItem key={optionObj.text} className={`py-0 ${maxTags !== undefined && tags.length >= maxTags ? "cursor-not-allowed" : "cursor-pointer"}}>
JaleelB commented 6 months ago

Apparently, this has fixed it!

-<CommandItem key={uuid()} className={`py-0 ${maxTags !== undefined && tags.length >= maxTags ? "cursor-not-allowed" : "cursor-pointer"}}>
+<CommandItem key={optionObj.text} className={`py-0 ${maxTags !== undefined && tags.length >= maxTags ? "cursor-not-allowed" : "cursor-pointer"}}>

Thank you for bringing this issue to our attention and for sharing your solution. It's great to hear that changing the key in the from uuid() to optionObj.text resolved the autocomplete problem. This issue was quite weird. I tried recreating it but didn't get the same results. Will keep an eye out for this though.