mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: make journal auto-adjustment for entries.
feat: auto-focus cells inside the table.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { useRef, useEffect } from 'react';
|
||||
|
||||
export default function useAutofocus() {
|
||||
export default function useAutofocus(focus = true) {
|
||||
const ref = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
if (ref.current) {
|
||||
if (ref.current && focus) {
|
||||
ref.current.focus();
|
||||
}
|
||||
}, [ref]);
|
||||
}, [ref, focus]);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user