Skip to content

Commit dd0de18

Browse files
committed
use clean tag name to compare with values from autocompleteParser as they are also clean
1 parent dea4679 commit dd0de18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Search/SearchRouter/SearchRouterList.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {getCardDescription, isCard, isCardIssued, mergeCardListWithWorkspaceFeed
2222
import {combineOrderingOfReportsAndPersonalDetails, getSearchOptions, getValidOptions} from '@libs/OptionsListUtils';
2323
import type {Options, SearchOption} from '@libs/OptionsListUtils';
2424
import Performance from '@libs/Performance';
25-
import {getAllTaxRates, getCleanedTagName} from '@libs/PolicyUtils';
25+
import {escapeTagName, getAllTaxRates, getCleanedTagName} from '@libs/PolicyUtils';
2626
import type {OptionData} from '@libs/ReportUtils';
2727
import {
2828
getAutocompleteCategories,
@@ -229,14 +229,15 @@ function SearchRouterList(
229229
case CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG: {
230230
const autocompleteList = autocompleteValue ? tagAutocompleteList : recentTagsAutocompleteList ?? [];
231231
const filteredTags = autocompleteList
232+
.map(getCleanedTagName)
232233
.filter((tag) => tag.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(tag.toLowerCase()))
233234
.sort()
234235
.slice(0, 10);
235236

236237
return filteredTags.map((tagName) => ({
237238
filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.TAG,
238-
text: getCleanedTagName(tagName),
239-
autocompleteID: tagName,
239+
text: tagName,
240+
autocompleteID: escapeTagName(tagName),
240241
mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG,
241242
}));
242243
}

0 commit comments

Comments
 (0)