question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Text] Highlight Text on Press

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ssomnoremaccommented, Jan 24, 2016

@corbt Would very much like to see this implemented on Android as any serious reading application in RN would require textual interactions.

0reactions
mkonicekcommented, Oct 27, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript: How to highlight text with pressing "Enter/Return"?
I'm trying to create a functioning search box that highlights words in a text. However, I cannot make it do the search by...
Read more >
Highlight your text - Microsoft Support
Text highlighting in PowerPoint for Microsoft 365 and PowerPoint 2019 lets subscribers mark text in yellow or another highlighter color.
Read more >
How to Highlight Text in PowerPoint (5 Ways) - Avantix Learning
Select the highlighted text. · Click the Home tab in the Ribbon. · Click the arrow next to Text Highlight Color in the...
Read more >
Highlight, underline, and strike out text in a PDF using Preview ...
Quickly highlight, underline, or strike through text: Select text, click the down arrow next to the Highlight button , then choose a highlight...
Read more >
Highlight Text in PowerPoint 365 for Windows - Indezine
With no text selected, access the Home tab and click the arrow button next to the Text Highlight Color. Choose the highlight color...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found