Skip to content

Commit 6948872

Browse files
Merge pull request #339 from CivicDataLab/search_input_fix
set default value from query params for search input
2 parents 9fcb436 + 07812c4 commit 6948872

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/[locale]/(user)/components/ListingComponent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ const ListingComponent: React.FC<ListingProps> = ({
410410
<div className="flex flex-wrap items-center justify-between gap-5 rounded-2 py-2 lg:flex-nowrap">
411411
<div className="w-full md:block">
412412
<SearchInput
413+
key={queryParams.query}
413414
label="Search"
414415
name="Search"
415416
className={cn(Styles.Search)}
416417
placeholder={placeholder}
418+
defaultValue={queryParams.query}
417419
onSubmit={(value) => handleSearch(value)}
418420
onClear={(value) => handleSearch(value)}
419421
/>

0 commit comments

Comments
 (0)