Skip to content
Snippets Groups Projects
Unverified Commit f606d92c authored by lelemm's avatar lelemm Committed by GitHub
Browse files

Changing the autocomplete search to accept text without accents to match...

Changing the autocomplete search to accept text without accents to match options with accents (#2842)

* Changing the autocomplete search to accept text without accents to match options with accents

* lint fix

* Added upcoming-release-notes
parent 8b850f14
No related branches found
No related tags found
No related merge requests found
...@@ -92,7 +92,16 @@ export function defaultFilterSuggestion<T extends Item>( ...@@ -92,7 +92,16 @@ export function defaultFilterSuggestion<T extends Item>(
suggestion: T, suggestion: T,
value: string, value: string,
) { ) {
return getItemName(suggestion).toLowerCase().includes(value.toLowerCase()); return getItemName(suggestion)
.toLowerCase()
.normalize('NFD')
.replace(/\p{Diacritic}/gu, '')
.includes(
value
.toLowerCase()
.normalize('NFD')
.replace(/\p{Diacritic}/gu, ''),
);
} }
function defaultFilterSuggestions<T extends Item>( function defaultFilterSuggestions<T extends Item>(
......
---
category: Enhancements
authors: [lelemm]
---
Enhanced autocomplete for languages with accents like Portuguese. Matches search queries regardless of accents.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment