Skip to content

Commit 07812c4

Browse files
committed
set default value from query params for search input
1 parent 206fca1 commit 07812c4

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
@@ -396,10 +396,12 @@ const ListingComponent: React.FC<ListingProps> = ({
396396
<div className="flex flex-wrap items-center justify-between gap-5 rounded-2 py-2 lg:flex-nowrap">
397397
<div className="w-full md:block">
398398
<SearchInput
399+
key={queryParams.query}
399400
label="Search"
400401
name="Search"
401402
className={cn(Styles.Search)}
402403
placeholder={placeholder}
404+
defaultValue={queryParams.query}
403405
onSubmit={(value) => handleSearch(value)}
404406
onClear={(value) => handleSearch(value)}
405407
/>

0 commit comments

Comments
 (0)