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:
parent
0e3bc92a61
commit
4124ab17d2
5 changed files with 13 additions and 4 deletions
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue