@@ -22,7 +22,7 @@ import {getCardDescription, isCard, isCardIssued, mergeCardListWithWorkspaceFeed
22
22
import { combineOrderingOfReportsAndPersonalDetails , getSearchOptions , getValidOptions } from '@libs/OptionsListUtils' ;
23
23
import type { Options , SearchOption } from '@libs/OptionsListUtils' ;
24
24
import Performance from '@libs/Performance' ;
25
- import { getAllTaxRates , getCleanedTagName } from '@libs/PolicyUtils' ;
25
+ import { escapeTagName , getAllTaxRates , getCleanedTagName } from '@libs/PolicyUtils' ;
26
26
import type { OptionData } from '@libs/ReportUtils' ;
27
27
import {
28
28
getAutocompleteCategories ,
@@ -229,14 +229,15 @@ function SearchRouterList(
229
229
case CONST . SEARCH . SYNTAX_FILTER_KEYS . TAG : {
230
230
const autocompleteList = autocompleteValue ? tagAutocompleteList : recentTagsAutocompleteList ?? [ ] ;
231
231
const filteredTags = autocompleteList
232
+ . map ( getCleanedTagName )
232
233
. filter ( ( tag ) => tag . toLowerCase ( ) . includes ( autocompleteValue . toLowerCase ( ) ) && ! alreadyAutocompletedKeys . includes ( tag . toLowerCase ( ) ) )
233
234
. sort ( )
234
235
. slice ( 0 , 10 ) ;
235
236
236
237
return filteredTags . map ( ( tagName ) => ( {
237
238
filterKey : CONST . SEARCH . SEARCH_USER_FRIENDLY_KEYS . TAG ,
238
- text : getCleanedTagName ( tagName ) ,
239
- autocompleteID : tagName ,
239
+ text : tagName ,
240
+ autocompleteID : escapeTagName ( tagName ) ,
240
241
mapKey : CONST . SEARCH . SYNTAX_FILTER_KEYS . TAG ,
241
242
} ) ) ;
242
243
}
0 commit comments