我有一个多行设置为true的基本文本输入。此外,它还设置了selection和onSelectionChange属性,每当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}}
/>发布于 2020-11-03 22:41:32
只是不使用selection道具就能解决这个问题!
https://stackoverflow.com/questions/64639411
复制相似问题