afcapel / stimulus-autocomplete

Stimulus autocomplete component
MIT License
478 stars 61 forks source link

Combo Box with client-side fuzzy finder with a static list options #135

Open alexspark opened 1 year ago

alexspark commented 1 year ago

I would like the ability to fuzzy search on the client-side with a static list of options. this would mean that we either implement our own fuzzy searcher and/or allow the ability to bring our own fuzzy search library.

The use case is where the list of options is not short enough to just use a select tag and not long enough that it's worth going to the server. Coupled with something like nested forms and accepts_nested_attributes_for, it seems like a waste to go to the server to get the results every time.

Example might be a combo box for a certain president of the united states. that list is not going to change often and going to the server seems wasteful of every keydown. or imagine you're making a fantasy basketball team where its players can only be US presidents. I'd dynamically add comboboxes but i don't want to send a xhr request for every member.