RichTextBlock hyperlinks do not work with touch on Windows 11
See original GitHub issueDescribe the bug
Tapping a Hyperlink
present in RichTextBlock
content does nothing on Windows 11.
Steps to reproduce the bug
- Install the XAML Controls Gallery app
- Open the XAML Controls Gallery app and navigate to the RichTextBlock sample. (Navigate to Text > RichTextBlock or use deep link
xamlcontrolsgallery://item/RichTextBlock
) - Click the
hyperlinks
link in the second sample. Observe the browser opens. - Tap the
hyperlinks
link in the second sample. Observe nothing happens.
Or create a blank app with one of the affected NuGet packages below.
Feedback Hub link from @marcant01: https://aka.ms/AAf9oe4
❌ This critically impacts app accessibility. Please strongly consider for servicing. (cc: @codendone)
Expected behavior
Similar or same behavior (hyperlink handler executes, browser opens, etc.) in both click and tap scenarios.
NuGet package version
- 2.7
- 2.8.0-prerelease.210927001
- Windows App SDK 1.0 (cc: @andrewleader)
Windows app type
UWP/Win32
Device form factor
Desktop
Windows version
Windows 11 22000.194 (RTM) and above
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:20 (8 by maintainers)
Top Results From Across the Web
[UWP & Windows 11] - touch has stopped working in ...
Tapping a Hyperlink inline element in a RichTextBlock in a UWP application on Windows 10 works (executes the command set on the Command ......
Read more >Hyperlinks work with mouse click but not touch screen
Based on your description, it seems that in SlideShow mode, the hyperlinks work with mouse click but not touch screen, but if start...
Read more >Content links in text controls - Windows apps
Learn how to use content links to embed rich data in the TextBlock, RichTextBlock, and RichEditBox controls.
Read more >RichTextBlock Class (Windows.UI.Xaml.Controls)
Represents a rich text display container that supports formatted text, hyperlinks, inline images, and other rich content. RichTextBlock supports a built-in ...
Read more >RichTextBlockOverflow Class (Windows.UI.Xaml.Controls)
Represents a rich text display overflow container. This element cannot have direct content. The only purpose of RichTextBlockOverflow is to display text ...
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
From what I can tell, this is caused by CommonStyles/Hyperlink_themeresources.xaml#L23
<x:Boolean x:Key="HyperlinkUnderlineVisible">False</x:Boolean>
. Setting this value to True resolves the problem. Interestingly, despite the name, HyperlinkUnderlineVisible does not seem to affect whether the hyperlink underline is visible. This problem affects WinUI 2 and WinUI 3 in the same way. It looks like HyperlinkUnderlineVisible was added in Windows 11, as it is present and set to True in the generic.xaml file for 10.0.22000.0.In my opinion, just strike the HyperlinkUnderlineVisible line in the WinUI style, since a) it didn’t work anyway, and b) it would resolve this issue, which is a major usability concern.
I’ve asked the team to dive into this.