Closed ketwaroo closed 13 years ago
thanks for fix. new version pushed can you test it?
aah. I'm pretty stupid. I edited the code I submitted. very sorry about that. I was just leaving work and in a hurry.
the problem was actually that the case insensitive search wasn't working. Uppercase characters were not matching lowercase counterparts and vice versa.
so, yeah. it's
if(options.filter_case)
reg = new RegExp(text,"g");
else
reg = new RegExp(text,"gi");
instead of
if(options.filter_case)
reg = new RegExp(text,"i"); // this should be just a g modifier instead of i
else
reg = new RegExp(text,"gi");
ok changes pushed ;) (actually it`s my bad, i should check it before push)
Also, a fix for itemIllumination to hilight the correct letters when filter_case is used. There was a try catch block in there. Not sure if it's useful.
function itemIllumination(text, etext) {
try {
var regex = new RegExp("(" + etext + ")", (options.filter_case) ?"g":"ig");
var text = text.replace(regex,'<em>$1</em>');
} catch(ex) {
};
return text;
}
added.
Basically if you have a list of items salt,sock,sand belt,somersault,etc. and you type "S" upper case S, you have nothing matched. It's on the master branch. I'm guessing the latest revision.
I sort of did a quick and dirty fix on it by adding a regex search. in jquery.fcbkcomplete.js around line 519. in the cache object.