fix: Fix select behaviour
This commit is contained in:
@@ -76,7 +76,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
textField.current.ref.current.select();
|
||||
textField.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ const TextFileAddModal = React.memo(({ content, onCreate, onClose }) => {
|
||||
}, [content, onCreate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
nameField.current.focus();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -66,7 +66,7 @@ const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate },
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
field.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -81,12 +81,12 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
nameField.current.ref.current.select();
|
||||
nameField.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.ref.current.select();
|
||||
nameField.current.ref.current.focus();
|
||||
}, [selectNameFieldState]);
|
||||
|
||||
if (!isOpened) {
|
||||
|
||||
@@ -71,7 +71,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
field.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user