Skip to content

Commit

Permalink
Fix search tool on localised countries page
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Dec 13, 2024
1 parent 044134a commit 714dfb0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ const Countries = ({ countries }) => {
searchInput !== ''
? sortedCountries.filter(
(country) =>
country.name.toLowerCase().indexOf(searchInput.toLowerCase()) >
-1,
country.localisedName
.toLowerCase()
.indexOf(searchInput.toLowerCase()) > -1,
)
: sortedCountries,
[searchInput],
Expand All @@ -122,6 +123,7 @@ const Countries = ({ countries }) => {
setSearchInput(searchTerm)
}

// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
const debouncedSearchHandler = useMemo(() => debounce(searchHandler, 200), [])

// Africa Americas Asia Europe Oceania Antarctica
Expand Down

0 comments on commit 714dfb0

Please sign in to comment.