fix: hotkey error when quick search blur

This commit is contained in:
JimmFly
2022-12-19 12:05:04 +08:00
parent 995a0bfead
commit abbe1dc014
@@ -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:">