Skip to content

The open alternative to Salesforce, designed for AI.

Place cursor at end when entering cell (#3743)

Jeet Desaidda9eaca2a05
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
index dd14285bbed..7a354a1383f 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
@@ -1,4 +1,4 @@
-import { ChangeEvent, useRef, useState } from 'react';
+import { ChangeEvent, useEffect, useRef, useState } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import styled from '@emotion/styled';
@@ -54,6 +54,15 @@ export const TextAreaInput = ({
const wrapperRef = useRef<HTMLTextAreaElement>(null);
+ useEffect(() => {
+ if (wrapperRef.current) {
+ wrapperRef.current.setSelectionRange(
+ wrapperRef.current.value.length,
+ wrapperRef.current.value.length,
+ );
+ }
+ }, []);
+
useRegisterInputEvents({
inputRef: wrapperRef,
inputValue: internalText,