From 422ffb2897bb2664eb47b5aaad5094a8b39431bf Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya <49753983+AshishBarvaliya@users.noreply.github.com> Date: Sat, 27 May 2023 08:33:18 -0400 Subject: [PATCH] fix: Text input cursor jumps to first position when writing long text (#2413) --- src/components/TextInput/TextInput.react.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/TextInput/TextInput.react.js b/src/components/TextInput/TextInput.react.js index 38149edf12..6ab9df19a5 100644 --- a/src/components/TextInput/TextInput.react.js +++ b/src/components/TextInput/TextInput.react.js @@ -15,6 +15,7 @@ class TextInput extends React.Component { if (props.multiline !== this.props.multiline) { const node = props.forwardedRef.current; node.focus(); + if (this.props.value) node.setSelectionRange(this.props.value.length, this.props.value.length); } }