There was an error while loading. Please reload this page.
1 parent 58aabfe commit c2c5e4aCopy full SHA for c2c5e4a
src/main/default/lwc/lookup/lookup.js
@@ -58,7 +58,8 @@ export default class Lookup extends LightningElement {
58
// Clone results before modifying them to avoid Locker restriction
59
const resultsLocal = JSON.parse(JSON.stringify(results));
60
// Format results
61
- const regex = new RegExp(`(${this._searchTerm})`, 'gi');
+ const escapedSearchTerm = this._searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
62
+ const regex = new RegExp(`(${escapedSearchTerm})`, 'gi');
63
64
const splicedResults = resultsLocal.splice(0, this.maxDisplayedResults);
65
0 commit comments