Skip to content

Commit afa0e25

Browse files
authored
Normalizes search string in supply filter so it ignores accents (#125)
* normalized search string to ignore accents * revert removed button
1 parent 466242b commit afa0e25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/EditShelterSupply/EditShelterSupply.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const EditShelterSupply = () => {
3030
if (v) {
3131
setFilteredSupplies(
3232
supplies.filter((s) =>
33-
s.name.toLowerCase().includes(v.toLowerCase())
33+
s.name.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')
34+
.includes(v.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ''))
3435
)
3536
);
3637
} else setFilteredSupplies(supplies);

0 commit comments

Comments
 (0)