diff --git a/client/src/components/Card/NameEdit.jsx b/client/src/components/Card/NameEdit.jsx index 8244617..48b7dec 100644 --- a/client/src/components/Card/NameEdit.jsx +++ b/client/src/components/Card/NameEdit.jsx @@ -79,7 +79,9 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => useEffect(() => { if (isOpened) { - field.current.ref.current.focus(); + const text = field.current.ref.current; + text.focus(); + text.setSelectionRange(text.value.length + 1, text.value.length + 1); } }, [isOpened]); diff --git a/client/src/components/CardModal/Activities/CommentEdit.jsx b/client/src/components/CardModal/Activities/CommentEdit.jsx index 6da2383..c75c8a7 100755 --- a/client/src/components/CardModal/Activities/CommentEdit.jsx +++ b/client/src/components/CardModal/Activities/CommentEdit.jsx @@ -70,7 +70,9 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref) useEffect(() => { if (isOpened) { - textField.current.ref.current.focus(); + const text = textField.current.ref.current; + text.focus(); + text.setSelectionRange(text.value.length + 1, text.value.length + 1); } }, [isOpened]); diff --git a/client/src/components/CardModal/Tasks/NameEdit.jsx b/client/src/components/CardModal/Tasks/NameEdit.jsx index 2c92680..2f26b27 100755 --- a/client/src/components/CardModal/Tasks/NameEdit.jsx +++ b/client/src/components/CardModal/Tasks/NameEdit.jsx @@ -65,7 +65,9 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => useEffect(() => { if (isOpened) { - field.current.ref.current.focus(); + const text = field.current.ref.current; + text.focus(); + text.setSelectionRange(text.value.length + 1, text.value.length + 1); } }, [isOpened]); diff --git a/client/src/components/List/NameEdit.jsx b/client/src/components/List/NameEdit.jsx index c916726..cbd65c4 100755 --- a/client/src/components/List/NameEdit.jsx +++ b/client/src/components/List/NameEdit.jsx @@ -71,7 +71,9 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => useEffect(() => { if (isOpened) { - field.current.ref.current.select(); + const text = field.current.ref.current; + text.focus(); + text.setSelectionRange(text.value.length + 1, text.value.length + 1); } }, [isOpened]);