yairEO / tagify

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

Enter tags without any delimiters in mix mode / Empty Pattern #1310

Closed finddeepali closed 8 months ago

finddeepali commented 8 months ago

Hi @yairEO , Thank you for this library. I know this issue was reported earlier https://github.com/yairEO/tagify/issues/163 But i did not understand conclusion on this.

I am using mixed mode to create a search box to support both of below use cases

  1. Type a text like 'social" and show all autosuggest entries like google.

    image
  2. in the same text box if i type '#mysearchtext' all entries matching mysearchtext like github

    image

For this reason, i cant fix my pattern to '#'. empty pattern will suit my usecase better.

I can not have two separate input boxes for above use cases. They need to be the same input element. Any suggestions on this is highly appreaciated.

Thank you.

yairEO commented 8 months ago

Doesn't seem you need mix-mode at all. Seems like a search box with a single value.

There is a section in the README that shows how to exactly do what you want: https://github.com/yairEO/tagify#ajax-whitelist

finddeepali commented 8 months ago

hi @yairEO , Thanks for your reply.

I have explained partial use case above. the actual use case to be able to type free text along with showing pills from selected options (this is selected by typing # , this is separate api call only for # use case).

image

however in absense of # character we still need to be able to match and autosuggest based on whatever text is typed (these are different options than # ones), which is why i am looking for empty pattern

yairEO commented 8 months ago

The link in my last comment has a code example showcasing how it can be done