简体   繁体   中英

Text selection react-native

I have some problems with text selection in react-native:

  1. How to select text across multiple text component
  2. How to detect text selection
  3. How to change text selection range

Example:

<View>
  <Text>test1</Text>
  <Text>test2</Text>
</View>

User should have possibility to select "test1 tes", and app should detect it and change selection to "test1 test2"?

It'll be cool if it'll works on android.

I found only https://github.com/facebook/react-native/commit/6cd712713b1673f13510bc127ac970648f9b5eb3 but it's only inside one text block.

At the moment I can't see a way to make this in React Native.

But, if you can use a rich text editor, try this: https://github.com/HoneyBook/react-native-richtext-editor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM