For example i have a TextInput like this
<ScrollView style={{flex: 1}}>
<TextInput
placeholder="Input"
style={{fontSize: 50}}
value={'Sample text'}
/>
</ScrollView>
So normally, when we click on the TextInput, it will automatic show caret at the end of text ( on android ), no matter where we click, at the first time, it will have the caret at the end, like this
BUT HOW can we set the caret in where we click, for example when we click the "m" letter, it will have caret after the "m", like this
Problem is, as i said, on android we always have the the caret at the end first, then if we click other, the caret will more to that, like this
I mean, it not a problem when text is short, but imagine, the text will like this
And we want to edit some text that already exist, so it scroll all the way down to the bottom (because the bottom contain the lastest text)
So my question is
HOW CAN WE SET THE CARET ON WHERE WE TOUCH (OR CLICK), NOT FROM LASTEST WORD IN TEXTINPUT?
You need to request focus to this TextInput.
<TextInput
placeholder="Input"
autofocus={true}
style={{fontSize: 50}}
value={'Sample text'}
/>
Or if it will not be working, write this please https://github.com/react-native-modal/react-native-modal/issues/516