TapGestureRecognizer does not work in label's span
See original GitHub issueDescription
In the following xaml, tap does’t work and react to the finger tap.
<Label>
<Label.FormattedText>
<FormattedString>
<Span Text="Alternatively, click " />
<Span Text="here"
TextColor="Blue" FontSize="24"
TextDecorations="Underline">
<Span.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}"
CommandParameter="https://docs.microsoft.com/dotnet/maui/" />
</Span.GestureRecognizers>
</Span>
<Span Text=" to view .NET MAUI documentation." />
</FormattedString>
</Label.FormattedText>
</Label>
Steps to Reproduce
create an maui app add label and some span add TapGestureRecognizer
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 10、windows sdk 10.0.19041.0
Did you find any workaround?
no workaround. but TapGestureRecognizer in label works like the following xaml: <Label Text="here" TextColor="Blue" FontSize="24" TextDecorations="Underline"> <Label.GestureRecognizers> <TapGestureRecognizer Command="{Binding TapCommand}" CommandParameter="https://docs.microsoft.com/dotnet/maui/" /> </Label.GestureRecognizers> </Label>
Relevant log output
no
Issue Analytics
- State:
- Created a year ago
- Reactions:9
- Comments:5
Top Results From Across the Web
Span.GestureRecognizers - TapGestureRecognizer not ...
The Label.GestureRecognizers fires the OnCounterClicked event on click. The Span.GestureRecognizers does not fire the OnCounterClicked event on ...
Read more >TapGestureRecognizer doesn't work for Span inside Label ...
GestureRecognizers that it doesn't work for Span inside Label in MAUI .NET. You can ... As an alternative workaround, you can use Label....
Read more >[SOLVED] TapGesture won't work with Span
so, I've encountered this issue - a tap gesture won't be triggered/fired on a Span - a while ago and now tried again...
Read more >TapGestureRecognizer not working with Spans on iOS
Tap gesture not working on iOS devices below is the code. <Label Grid.Column="1" Padding="10" x:Name="lblPrivacyLink"> <Label.FormattedText>
Read more >Span Label underline is not working on Xamarin iOS
I'm using a Label with Spans, one of them is a link and I want to add an underline style, I'm using <Span...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is annoying.
Copied and pasted the following code from the official docs at: https://docs.microsoft.com/en-us/dotnet/maui/user-interface/controls/label
The Command never fires!! HOW do we set-up a hyperlink in .Net MAUI ??
PLEASE update code example or provide workaround.
Thanks in advance.