JS custom select lib that works well with LiveView

What custom select JS library are you using right now that is working well with LiveView? We are trying to get away with Select2 cause it is an outdated library and we want to remove Jquery dependencies.

Have you tried LiveSelect?

It doesn’t require any JS dependency - it’s pure LiveVIew.

I’m the author, if you try it out I’d love to hear your feedback and suggestions.

1 Like

Hey @trisolaran we are looking into that. Does it support searching options, paginated options, and multiple mode?

Hi @dgigafox

  • searching options: the component doesn’t filter your options automatically, it sends the text entered by the user to your LV, which is supposed to do the search and send the updated options, basically like a data source in select2. I see that select2 can filter options out-of-the-box (but only if they’re static). LiveSelect doesn’t do that. But this is easily (and probably better) implemented in your LiveView using the above mechanism
  • paginated options: I’m assuming you’re referring to the select2 pagination feature when using data sources: Data sources | Select2 - The jQuery replacement for select boxes. No, LiveSelect doesn’t support it and I didn’t even think about it so far. Probably something that would be nice to have
  • multiple mode: no, not yet supported but it’s the very next item on my to-do list.

As you can see the library is quite new, I released it less than 2 months ago :grimacing: