Skip to content

Commit 8287b5f

Browse files
authored
Merge pull request #2638 from apsinghdev/fix/cursor-position
fixes wrong position of cursor
2 parents 259ad33 + e01d780 commit 8287b5f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/modules/IDE/components/EditableInput.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ function EditableInput({
2828
const { t } = useTranslation();
2929
React.useEffect(() => {
3030
if (isEditing) {
31-
inputRef.current?.focus();
31+
const inputElement = inputRef.current;
32+
inputElement.setSelectionRange(
33+
inputElement.value.length,
34+
inputElement.value.length
35+
);
36+
inputElement.focus();
3237
}
3338
}, [isEditing]);
3439
React.useEffect(() => {

0 commit comments

Comments
 (0)