shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.72k stars 991 forks source link

Search by group? #456

Closed iamvitali closed 7 years ago

iamvitali commented 7 years ago

Is there a way to search groups in <multiselect>?

So if it finds a group I would see the group label and all the options for that group.

Zip753 commented 7 years ago

If you pass the groups to <multiselect>, then you have the control over them, right? :) So simply find the group you want in the options you're passing, it doesn't have to do anything with <multiselect> really.

shentao commented 7 years ago

What I think @Zip753 might mean is that you can use your own search function by disabling the :internal-search by passing false. This way you can react to @search changes yourself and adjust the :options. Ofc you will have to mimic the results structure as it is in multiselect itself to fit the grouping requirements but that shouldn’t be much of a problem. Please look into the source code to see an example of such transform.

Zip753 commented 7 years ago

My bad, I thought of programmatic search somehow.

mrleblanc101 commented 2 years ago

Why did you close ? It would be a nice enhancement to have this natively. It make sense to be able to search by group name since they are clickable (select all the children options).