multiselect
multiselect copied to clipboard
Ability to search by option value and label
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.
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.
I'll try to find an way of doing this. Any suggestions are welcomed.
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
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.
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.