mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
fix: hotkey error when quick search blur
This commit is contained in:
@@ -17,13 +17,19 @@ export const Input = (props: {
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
useEffect(() => {
|
||||
inputRef.current?.addEventListener(
|
||||
'blur',
|
||||
() => {
|
||||
inputRef.current?.focus();
|
||||
},
|
||||
true
|
||||
);
|
||||
return inputRef.current?.focus();
|
||||
}, [inputRef]);
|
||||
useEffect(() => {
|
||||
return setInputValue(props.query);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<StyledInputContent>
|
||||
<StyledLabel htmlFor=":r5:">
|
||||
|
||||
Reference in New Issue
Block a user