File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/default/lwc/lookup Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ export default class Lookup extends LightningElement {
4242 this . searchResults = resultsLocal . map ( ( result ) => {
4343 // Clone and complete search result if icon is missing
4444 if ( this . searchTerm . length > 0 ) {
45- const regex = new RegExp ( this . searchTerm , 'gi' ) ;
45+ const regex = new RegExp ( `( ${ this . searchTerm } )` , 'gi' ) ;
4646 result . titleFormatted = result . title
47- ? result . title . replace ( regex , '<b>' + this . searchTerm + '</b >')
47+ ? result . title . replace ( regex , '<strong>$1</strong >' )
4848 : result . title ;
4949 result . subtitleFormatted = result . subtitle
50- ? result . subtitle . replace ( regex , '<b>' + this . searchTerm + '</b >')
50+ ? result . subtitle . replace ( regex , '<strong>$1</strong >' )
5151 : result . subtitle ;
5252 }
5353 if ( typeof result . icon === 'undefined' ) {
You can’t perform that action at this time.
0 commit comments