Skip to content

Commit 422ffb2

Browse files
fix: Text input cursor jumps to first position when writing long text (#2413)
1 parent 23451e3 commit 422ffb2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/TextInput/TextInput.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class TextInput extends React.Component {
1515
if (props.multiline !== this.props.multiline) {
1616
const node = props.forwardedRef.current;
1717
node.focus();
18+
if (this.props.value) node.setSelectionRange(this.props.value.length, this.props.value.length);
1819
}
1920
}
2021

0 commit comments

Comments
 (0)