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.

Can i set @tap event on <Span> into <FormattedString>

See original GitHub issue

Hello

Case: I want to write link into text, but i cant set event @tap on <Span> element, because it doesn’t work. How can i solve this problem?

Example:

<FormattedString>
   <Span text="Some text:  " />
   <Span text="link" @tap="openUrl" />
</FormattedString>

How can i solve this problem?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
souriscloudcommented, Jul 20, 2020

Solution HERE! 😁 @ricky-bos @kostyabushuev

Guys I just solving this problem, when I have composed text with Privacy Policy and Terms of Service tapthru links, and its not wrapped to fit into screen. What I did was separate text into Labels (which are tapables - Span is not tappable because it has not its own View), and wrap thoose labels into WrapLayout. Now it works pretty well as expected. Give it a try!

1reaction
nhattercommented, Jul 1, 2022

I can confirm the above solution / workaround also works. Thanks @souriscloud !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nativescript FormattedString - tap event on a Span
The goal is when the user taps them to execute a function displaying the agreement or the policy. The problem is that the...
Read more >
formattedstring - spans tap gesture? - MSDN - Microsoft
Are there any ways to detect the tapping on a specific Span of a FormattedString? The only way I could possibly think right...
Read more >
Style for Label.FormattedString.Span broke...
I found out by trial and error that I can now specify TargetType="Span" on the Style and then it works. Visual Studio for...
Read more >
String resources | Android Developers
A single string that can be referenced from the application or from other resource ... In this formatted string, a <b> element is...
Read more >
UI & Styling - NativeScript Docs
You can use android.systemIcon to set one of the system icons available in Android. In this case, there is no default behaviour for...
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