Place cursor at end when entering cell (#3743)

#3723 #3724 place cursor at end when entering cell
This commit is contained in:
Jeet Desai 2024-02-01 22:07:32 +05:30 committed by GitHub
parent d667bc4a90
commit dda9eaca2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,