Closed Arual90 closed 6 years ago
Autocomplete-clab search functionality doesn't work when special characters are used. Es: [, +.
This is because it uses the function String.prototype.search which accepts a regExp or a string that can be turned into a RegExp.
String.prototype.search
const phrase = '[laura] è al mare'; phrase.search('laura') // -> correctly returns the index phrase.search('[laura') // -> Uncaught SyntaxError: Invalid regular expression
'[laura' cannot be turned into a RegExp unless the special character is escaped.
How To Fix: Escape the string using https://www.npmjs.com/package/escape-string-regexp
closed by #208
Autocomplete-clab search functionality doesn't work when special characters are used. Es: [, +.
This is because it uses the function
String.prototype.search
which accepts a regExp or a string that can be turned into a RegExp.'[laura' cannot be turned into a RegExp unless the special character is escaped.
How To Fix: Escape the string using https://www.npmjs.com/package/escape-string-regexp