mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-07-01 04:29:18 +00:00
NORY-45: fix search input value lost on reload
This commit is contained in:
parent
19e68b8929
commit
5e01a7f50f
2 changed files with 7 additions and 2 deletions
|
@ -5,13 +5,14 @@ import { useRouter, useSearchParams } from 'next/navigation';
|
|||
import { ChangeEvent, HTMLInputTypeAttribute } from 'react';
|
||||
|
||||
interface SearchInputProps {
|
||||
value: string;
|
||||
placeholder: string;
|
||||
queryParamKey: string;
|
||||
type?: HTMLInputTypeAttribute;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function SearchInput({ placeholder, queryParamKey, type, className }: SearchInputProps) {
|
||||
export function SearchInput({ value, placeholder, queryParamKey, type, className }: SearchInputProps) {
|
||||
|
||||
const router = useRouter();
|
||||
const params = useSearchParams();
|
||||
|
@ -32,6 +33,7 @@ export function SearchInput({ placeholder, queryParamKey, type, className }: Sea
|
|||
|
||||
return (
|
||||
<Input
|
||||
value={value}
|
||||
type={type ?? 'text'}
|
||||
placeholder={placeholder}
|
||||
className={className}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue