multiselect icon indicating copy to clipboard operation
multiselect copied to clipboard

Ability to search by option value and label

Open chaitanyavelaga opened this issue 6 years ago • 6 comments

chaitanyavelaga avatar Aug 18 '17 14:08 chaitanyavelaga

Could you please explain me the reason why you need this functionality? Basically from the UI you don't know which is the value of an option element, you just see the text / label. So thinking from a user experience perspective, this might introduce a lot of confusion.

crlcu avatar Aug 21 '17 08:08 crlcu

You are right. Is there a way we can match non utf8 characters with ascii characters while filtering? i.e. If I look Sao Paulo it should also return the values São Paulo.

chaitanyavelaga avatar Aug 24 '17 21:08 chaitanyavelaga

I'll try to find an way of doing this. Any suggestions are welcomed.

crlcu avatar Aug 25 '17 09:08 crlcu

I used accent_fold method in the following project on both search string and option label so that it converts any non English characters to English characters.

https://github.com/aristus/accent-folding/blob/master/accent-fold.js

On Fri, Aug 25, 2017 at 5:27 AM, Adrian Crisan [email protected] wrote:

I'll try to find an way of doing this. Any suggestions are welcomed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/crlcu/multiselect/issues/133#issuecomment-324868647, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVpZwtEi7kZYQekbjQg34DCQmllLuYZks5sbpNxgaJpZM4O7maT .

-- Chait2

chaitanyavelaga avatar Aug 25 '17 18:08 chaitanyavelaga

I would like to have as less dependencies as possible for this plugin, but I'll think of a way to solve the issue you described.

crlcu avatar Sep 13 '17 10:09 crlcu

More extensibility would be achieved if I could specify what attribute to search on. Default: Label

Use case: I have a list of countries and as data attribute I have their alternate names, like

<option value="FI" data-search="Finland,Suomi">Finland</option>
<option value="GB" data-search="United Kingdom,Great Britain,England,Scottland,Wales">United Kingdom</option>
<option value="NL" data-search="Netherlands,Holland">Netherlands</option>

This way if I could specify data-search as property/attribute to do searching, then it will allow user to type alternate names and still get correct item from list.

salixzs avatar Aug 22 '18 16:08 salixzs