fix: exception display when restart quick search

This commit is contained in:
JimmFly
2022-12-16 14:25:26 +08:00
committed by QiShaoXuan
parent e9777a942c
commit 7b941c863c
2 changed files with 5 additions and 1 deletions
@@ -9,6 +9,7 @@ import { SearchIcon } from '@blocksuite/icons';
import { StyledInputContent, StyledLabel } from './style';
import { Command } from 'cmdk';
export const Input = (props: {
query: string;
setQuery: Dispatch<SetStateAction<string>>;
setLoading: Dispatch<SetStateAction<boolean>>;
}) => {
@@ -18,6 +19,9 @@ export const Input = (props: {
useEffect(() => {
return inputRef.current?.focus();
}, [inputRef]);
useEffect(() => {
return setInputValue(props.query);
}, []);
return (
<StyledInputContent>
<StyledLabel htmlFor=":r5:">