Has anyone created an autocomplete text input?
Has anyone created an autocomplete text input?
12 Replies
i think u can create that with custom components with alpine.js or whatever you like
Yes, I know, just in case someone already had one, I wouldn't waste time.
Why not just use a searchable select field?
Imagine that you entered on the phone and you need to press select to open the search input, then press input to activate it. it is desirable to write in the input at once.
A searchable select will do that when you click it opens the drop down and focuses the tyable area.
Iirc
Could also use a TextInput as a data list but the options are predefined and not tied to a relationship.
In my case, it should search from third-party API.
Can be done with the select also
I know, but that is not what i needed. After typing in the input, the dropdown should open.
then build your own custom. would have done in such time
That's what I'm going to do, just in case someone already had one, so I wouldn't waste time on it
Do what you need but it’s the same amount of steps. Click text field, type. Click select field type. 🙂
In the case of Select, it is 2 times. One to open the dropdown and one more to focus the input when using mobile. And you will click on input once to focus and type. In addition, in my opinion, the input version is more preferable as a user of the website.