-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with the RegExp replacement of the searchTerm #37
Comments
Hi @Katulka, if I get this right, you only have an issue on the JS side in production, right? Can you check that by logging search results in the dev console just before applying the regex like this: this.searchResults = results.map((result) => {
console.log(JSON.stringify(result, null, 2));
... |
Hi @pozil thanks so much. Hope you are well. FYI - this is helping a community screen visitors for Covid-19 reasons.. so it's important right now. Thanks for helping. Here you go.. I am also finding it's not the RegExp but simply the assignment of result.titleFormatted { |
This just fixed it, I think it's a scope/lwc restriction.. cut ties with the reference and it's working
|
Thanks for finding the issue so quickly @Katulka. Good luck with your project and stay safe. |
You are welcome and thanks @pozil |
Only in Production, having an issue with this line:
result.titleFormatted = result.title
? result.title.replace(regex, '' + this.searchTerm + '')
: result.title;
this.searchTerm = "he"
result.title = "obfuscated community name he"
Testing:
Cannot replicate this in sandbox.
For now I am getting rid of RegExp and doing this:
result.title.replace(this.searchTerm, '' + this.searchTerm + '')
The text was updated successfully, but these errors were encountered: