mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat: optimize the quick search function
This commit is contained in:
@@ -5,6 +5,7 @@ import { Command } from 'cmdk';
|
||||
export const Input = (props: {
|
||||
query: string;
|
||||
setQuery: Dispatch<SetStateAction<string>>;
|
||||
setLoading: Dispatch<SetStateAction<boolean>>;
|
||||
}) => {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
useEffect(() => {
|
||||
@@ -18,7 +19,10 @@ export const Input = (props: {
|
||||
<Command.Input
|
||||
ref={inputRef}
|
||||
value={props.query}
|
||||
onValueChange={props.setQuery}
|
||||
onValueChange={str => {
|
||||
props.setQuery(str);
|
||||
props.setLoading(true);
|
||||
}}
|
||||
placeholder="Quick Search..."
|
||||
/>
|
||||
</StyledInputContent>
|
||||
|
||||
Reference in New Issue
Block a user