mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-24 06:48:42 +03:00
Place cursor at end when entering cell (#3743)
#3723 #3724 place cursor at end when entering cell
This commit is contained in:
parent
d667bc4a90
commit
dda9eaca2a
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user