iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
590 stars 169 forks source link

Does this plugin allows copying content? (selectable) #126

Closed darron1217 closed 10 months ago

darron1217 commented 3 years ago

Does this plugin allows copying content? (selectable)

filipecatraia commented 3 years ago

I'm using it and, as far as I can tell, by default the answer is no. The source code doesn't include selectable when rendering <Text> elements. That said, you can override the rendering rules, passing your own custom components. Doing that, you could add selectable to each <Text> element the library renders, thus making the text selectable.

nabeelpkl commented 3 years ago

any solution for this? @darron1217

esalaza commented 1 year ago

You can use the userSelect style prop.

In React native v0.71.0 that style prop was added which receives the standard CSS user-select values, mapping them to selectable component prop using the map in that commit (userSelectToSelectableMap).