当multline设置为true时,IOS react native onSelectionChange将光标移动到初始



我有一个基本的文本输入,多行设置为true。此外,它还设置了selectiononSelectionChange道具,每当onChangeText发生变化时,光标就会移动到初始位置。

这是视频:https://streamable.com/bchsz4

这里是repro:https://github.com/VivekNeel/IOS_SELECTION_CHANGE这是示例代码:

<TextInput
onChangeText={handleChange}
value={value}
multiline
selection={selection}
onSelectionChange={handleSelection}
placeholder="Enter a text"
style={{marginTop: 100, marginHorizontal: 16}}
/>

只是不使用selection道具就解决了这个问题!

最新更新