diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index d728a78..b6a801b 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -149,14 +149,27 @@ export const HomePage = () => { />
-
+
{ + e.preventDefault() + const searchInput = e.currentTarget.elements.namedItem( + 'q' + ) as HTMLInputElement + setSearch(searchInput.value) + }} + > { - setSearch(e.currentTarget.value) - }} size="small" + type="search" + onChange={(e) => { + // Handle the case when users click native search input's clear or x + if (e.currentTarget.value === '') { + setSearch(e.currentTarget.value) + } + }} sx={{ width: '100%', fontSize: '16px', @@ -175,6 +188,7 @@ export const HomePage = () => { }} /> -
+