client: autofous when open search

This commit is contained in:
fantasticit 2022-05-30 12:25:04 +08:00
parent 52ee2a98bb
commit 1233211966
1 changed files with 1 additions and 5 deletions

View File

@ -66,7 +66,6 @@ const List: React.FC<{ data: IDocument[] }> = ({ data }) => {
export const Search = () => { export const Search = () => {
const [visible, toggleVisible] = useToggle(false); const [visible, toggleVisible] = useToggle(false);
// const { data: recentDocs } = useRecentDocuments();
const [searchApi, loading] = useAsyncLoading(searchDocument, 10); const [searchApi, loading] = useAsyncLoading(searchDocument, 10);
const [keyword, setKeyword] = useState(''); const [keyword, setKeyword] = useState('');
const [error, setError] = useState(null); const [error, setError] = useState(null);
@ -113,6 +112,7 @@ export const Search = () => {
<div style={{ paddingBottom: 24 }}> <div style={{ paddingBottom: 24 }}>
<div> <div>
<Input <Input
autofocus
placeholder={'搜索文档'} placeholder={'搜索文档'}
size="large" size="large"
value={keyword} value={keyword}
@ -143,10 +143,6 @@ export const Search = () => {
error={error} error={error}
normalContent={() => <List data={searchDocs} />} normalContent={() => <List data={searchDocs} />}
/> />
{/* <div style={{ marginTop: 16 }}>
<Text type="tertiary">访</Text>
<List data={recentDocs} />
</div> */}
</div> </div>
</div> </div>
</Modal> </Modal>