3

I used Text component reference: https://facebook.github.io/react-native/docs/text.html

with property selectable={true}, is there any solution to get the user text selection start and end on Text component not TextInput component?

because I need to make the text selectable with editable false.

Ivan Chernykh
  • 41,617
  • 13
  • 134
  • 146

1 Answers1

1

You can use this https://github.com/Astrocoders/react-native-selectable-text/

import { SelectableText } from "react-native-selectable-text";

// Use normally, it is a drop-in replacement for react-native/Text
<SelectableText
  menuItems={["Foo", "Bar"]}
  onSelection={({ eventType, content, selectionStart, selectionEnd }) => {}}
  value="I crave star damage"
/>;
fakenickels
  • 171
  • 6