1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-28 09:39:43 +02:00

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize';
import { Button, Form, TextArea } from 'semantic-ui-react';
import { useField } from '../../../hooks';
import { focusEnd } from '../../../utils/element-helpers';
import styles from './NameEdit.module.scss';
@ -65,7 +66,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
useEffect(() => {
if (isOpened) {
field.current.ref.current.focus();
focusEnd(field.current.ref.current);
}
}, [isOpened]);