[Text] Highlight Text on Press
See original GitHub issueI’m working on a chat application. The messages can have links, and I need to parse the text to identify the links.
By nesting Text
components, I’m able to give the links a blue color, and handle press on the link to open it in the browser. But it’s missing one important element, it doesn’t give any feedback when the link is pressed (I’m on Android).
The TouchableHighlight
component seem to be only working for views and not for text. So I cannot use it, as the links need to be inline with the rest of the text.
Are there any plans for providing a TouchableTextHighlight
or something like that? Or maybe even support Text
components with TouchableHighlight
?
Maybe my approach is all wrong. If so, is there another preferred method of handling such scenario? Maybe I could use setNativeProps
somehow?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:11 (3 by maintainers)
@corbt Would very much like to see this implemented on Android as any serious reading application in RN would require textual interactions.
Hi there! This issue is being closed because it has been inactive for a while.
But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/text-highlight-text-on-press
ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix. We’re a small team and rely on the community for bug fixes of issues that don’t affect fb apps.