bassjobsen / Bootstrap-3-Typeahead

The Typeahead plugin from Twitter's Bootstrap 2 ready to use with Bootstrap 3 and Bootstrap 4
1.68k stars 1.33k forks source link

The highlighter is not case insensitive #356

Open Matiaseid opened 6 years ago

Matiaseid commented 6 years ago

Even though the matcher is case insensitive, the highlighter is not.

This can be fixed by adding an 'i' to the end of all the regexes in the highlighter function.

ftedin commented 4 years ago

Still not fixed? any workaround? Thanks!

jaysee commented 2 years ago

Yes, I confirm the issue, you can fix it by adding the i flag to the regex used by the default highlighter in file bootstrap3-typeahead.js on line 316, update the code var reg = new RegExp(text, 'g'); by var reg = new RegExp(text, 'gi');

This should be fixed or be an option to enable this!