I know in previous versions of select2, stripDiacritics was exported so it was accessible outside of the default matcher. In the current version, 4.0.1 it seems impossible to write a custom matcher and using select2's stripDiacritics, since is not exported in $.fn.select2.defaults
What's the best way I can pull the original stripDiacritics
for me to write a custom matcher?
I'm trying to write a matcher that matches both the option's text and a data attribute. I'm trying to avoid patching select2's source, I imagine it will be nightmare if I follow that path.
Update
I've highlighted the actual question and posted additional details around the code I'm working with, as suggested in the comments:
I'm not asking for someone to write the new matcher (based on $.fn.select2.defaults.defaults.matcher
) for me, I'm simply asking for the best way to pull the original stripDiacritics
which is private, so that I can use it.
I could, simply copy the function (and it's dependencies: the DIACRITICS
object) to my code, but that's the hole I'm trying to avoid.