mirror of
https://github.com/plankanban/planka.git
synced 2025-07-27 17:19:43 +02:00
ref: Fix variable names
This commit is contained in:
parent
9998f554d6
commit
e1ac5959ba
4 changed files with 14 additions and 14 deletions
|
@ -17,7 +17,7 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
const [t] = useTranslation();
|
||||
const [isOpened, setIsOpened] = useState(false);
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectNameFieldState, selectNameField] = useToggle();
|
||||
const [focusNameFieldState, focusNameField] = useToggle();
|
||||
|
||||
const nameField = useRef(null);
|
||||
|
||||
|
@ -43,8 +43,8 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
selectNameField();
|
||||
}, [onCreate, data, setData, selectNameField]);
|
||||
focusNameField();
|
||||
}, [onCreate, data, setData, focusNameField]);
|
||||
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
|
@ -87,7 +87,7 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.ref.current.focus();
|
||||
}, [selectNameFieldState]);
|
||||
}, [focusNameFieldState]);
|
||||
|
||||
if (!isOpened) {
|
||||
return React.cloneElement(children, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue