4 ms·
> And, on the topic of components I wish existed (anywhere - react, vue, angular, etc - anything), I've been searching for a good rich multiselect for a long ti
by deergomoo 7y ago
> And, on the topic of components I wish existed (anywhere - react, vue, angular, etc - anything), I've been searching for a good rich multiselect for a long time! If you know of any please let me know :)
Select2 [1] has been around forever but it's always worked out pretty nicely for me.
It's a jQuery plugin, so it's somewhat out of vogue these days, but it's trivially easy to wrap it in a component to make it play nicely with Vue (in fact, the Vue documentation uses it as the example for writing wrapper components [2]). I imagine something similar can be done with React, Angular, etc., though I'm not too familiar with the process there.
[1] https://select2.org https://select2.org
[2] https://vuejs.org/v2/examples/select2.html https://vuejs.org/v2/examples/select2.html
- dpau 7y agonot that there's anything wrong with jquery or select2, both of which i used heavily in the past, but if you're working in vue it's a very nice feeling to just completely drop the jquery dependency. ive been using https://github.com/shentao/vue-multiselect https://github.com/shentao/vue-multiselect for over a year now in production and despite its quirks i'd recommend it.
- zemptime 7y agoooooh nice. I didn't know this was a thing. Yeah, the jquery bundle size really isn't justified for a single thing (rich multiselect). I recently ported `selectr` for use in an app at work, but I'd love to replace it as there's some wonkiness