mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: persistent search
This commit is contained in:
1 parent
7391937070
commit
5bcfa88f48
1 file changed
+2
@@ -15,6 +15,7 @@ interface SearchBarProps {
|
|||||||
|
|
||||||
export function SearchBar({ topResult, onSelect }: SearchBarProps) {
|
export function SearchBar({ topResult, onSelect }: SearchBarProps) {
|
||||||
const tankFiltersStore = TankFilters.useStore();
|
const tankFiltersStore = TankFilters.useStore();
|
||||||
|
const lastSearch = tankFiltersStore.getState().search;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const input = useRef<HTMLInputElement>(null);
|
const input = useRef<HTMLInputElement>(null);
|
||||||
const searching = TankFilters.use((state) => state.searching);
|
const searching = TankFilters.use((state) => state.searching);
|
||||||
@@ -58,6 +59,7 @@ export function SearchBar({ topResult, onSelect }: SearchBarProps) {
|
|||||||
<Flex justify="center" mt="4">
|
<Flex justify="center" mt="4">
|
||||||
<Flex gap="2" flexGrow="1">
|
<Flex gap="2" flexGrow="1">
|
||||||
<TextField.Root
|
<TextField.Root
|
||||||
|
defaultValue={lastSearch}
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
ref={input}
|
ref={input}
|
||||||
placeholder="Search tanks..."
|
placeholder="Search tanks..."
|
||||||
|
|||||||
Reference in new issue
Block a user