Skip to content

Commit 8696956

Browse files
committed
Changing the autocomplete search to accept text without accents to match options with accents
1 parent d62919a commit 8696956

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/desktop-client/src/components/autocomplete/Autocomplete.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export function defaultFilterSuggestion<T extends Item>(
9292
suggestion: T,
9393
value: string,
9494
) {
95-
return getItemName(suggestion).toLowerCase().includes(value.toLowerCase());
95+
return getItemName(suggestion).toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "")
96+
.includes(
97+
value.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "")
98+
);
9699
}
97100

98101
function defaultFilterSuggestions<T extends Item>(

0 commit comments

Comments
 (0)