by mg · 3y ago · 0 comments
https://github.com/no-gravity/0g-typeahead
It is humming away nicely, doing hundreds of thousands of typeaheads each day across my websites.
I always think I should finally do the work and get rid of the jquery dependency. But so far, I just did not got around doing it.
Two pro tips:
1. Apparently this is also called “combo box” - Tailwind has one: https://tailwindui.com/components/application-ui/forms/combo...
I eventually rolled my own using tailwind’s scaffold: it ended up being about 300 lines of JS to handle things like keyboard actions, pressing enter, focus/non-focus, denounce search.
But the benefit? It does exactly what I want.
Your repo doesn't have a license.
https://github.com/no-gravity/0g-typeahead/blob/master/0g-ty...
The project is pretty much that one file. Twitter put the license there, so it did never cross my mind to remove it and put it into an extra file.
But it might make sense to put the whole repo (which is just the typeahead.js file plus a little demo) under that license to avoid confusion.