md-autocomplete ignore characters with accent
Hello,
I'm using the md-autocomplete to use with searches that can result in cases like "René". I want my end user to type "Rene" and see "René" in the results.
Is there a way of doing that?
Thanks
@robertmesserle It seems to me that we should allow users to specify a custom matching function. What do you think?
@jelbourn Hm, that's a good point. This was discussed at some point in time, but I don't recall where that discussion ended up. I'm not sure what that matching function would look like, though - at that point, it might just require a custom directive rather than our out-of-the-box functionality.
Thank you @jelbourn and @robertmesserle for answering!
Inspite of the milestone, would you guys suggest a way of implementing this feature?
Modified MdHighlightCtrl to support diacritics (accents).
It could be done by replacing all diacritics letters with a regex (ex: e -> [eéèê]) or comparing strings without them.
Here's a gist of the progress i've done so far: https://gist.github.com/antoinebrault/eec14ea3fee725aebe49
It based on http://stackoverflow.com/questions/990904/javascript-remove-accents-diacritics-in-strings#answer-18391901
It seems to be working for me with french characters.
see: https://github.com/selectize/selectize.js/blob/043420284064ad998b07e1abd9720f56c86d6614/dist/js/standalone/selectize.js#L58 https://github.com/select2/select2/blob/8ad8f200ba8c9429d636453b8ee3bcf593e8c87a/src/js/select2/defaults.js#L300