focus on searchbar open
This commit is contained in:
parent
6c7a173947
commit
fc1c1f1858
|
@ -87,6 +87,11 @@ export default function SearchBar(props: Props) {
|
|||
const [stats, setStats] = useState<Stats>(null);
|
||||
const selectRef = useRef(null);
|
||||
useEffect(() => {
|
||||
if (props.isOpen) {
|
||||
setTimeout(() => {
|
||||
selectRef.current?.focus();
|
||||
}, 250);
|
||||
}
|
||||
if (!props.isOpen && allFiles?.length > 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue