fix: Focus end of field when editing (#779)

This commit is contained in:
HannesOberreiter
2024-06-06 20:06:16 +02:00
committed by GitHub
parent 0e3bc92a61
commit 4124ab17d2
5 changed files with 13 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import TextareaAutosize from 'react-textarea-autosize';
import { Button, Form, TextArea } from 'semantic-ui-react';
import { useForm } from '../../../hooks';
import { focusEnd } from '../../../utils/element-helpers';
import styles from './CommentEdit.module.scss';
@@ -70,7 +71,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
useEffect(() => {
if (isOpened) {
textField.current.ref.current.focus();
focusEnd(textField.current.ref.current);
}
}, [isOpened]);