mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 17:23:21 +03:00
ref: Fix variable names
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user