Skip to content

Commit

Permalink
fix: ensuring non english character match
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Feb 21, 2023
1 parent f65cd19 commit e2d3ae4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const getFilteredItems = (val, list, should_filter_by_char) => {
? item.toLowerCase().includes(val)
: item.text
.normalize('NFD')
.replace(/[^a-z]/i, '')
.split('')
.filter(char => /^[a-z ]*$/i.test(char))
.join('')
.toLowerCase()
.includes(val) || item.text.toLowerCase().includes(val)
);
Expand Down

0 comments on commit e2d3ae4

Please sign in to comment.