diff --git a/react/src/@/components/SearchField.tsx b/react/src/@/components/SearchField.tsx index fa610a0..4fe5cc1 100644 --- a/react/src/@/components/SearchField.tsx +++ b/react/src/@/components/SearchField.tsx @@ -1,5 +1,6 @@ import { SetState } from "@/types"; import "./SearchField.css"; +import { useEffect, useState } from "react"; interface Props { search: string; @@ -7,10 +8,17 @@ interface Props { } export const SearchField: React.FC = ({ search, setSearch }) => { + const [textInput, setTextInput] = useState(null); + + useEffect(() => { + if (textInput !== null) { + textInput.select(); + } + }, [textInput]); return (
- setSearch(e.target.value)} /> + setSearch(e.target.value)} /> { search !== '' && () }
);