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.

RichTextBlock hyperlinks do not work with touch on Windows 11

See original GitHub issue

Describe the bug

Tapping a Hyperlink present in RichTextBlock content does nothing on Windows 11.

Steps to reproduce the bug

  1. Install the XAML Controls Gallery app
  2. Open the XAML Controls Gallery app and navigate to the RichTextBlock sample. (Navigate to Text > RichTextBlock or use deep link xamlcontrolsgallery://item/RichTextBlock)
  3. Click the hyperlinks link in the second sample. Observe the browser opens.
  4. 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

richtextblock_touch_g88

❌ 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:open
  • Created 2 years ago
  • Reactions:12
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
BreeceWcommented, Dec 22, 2021

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.

2reactions
bpulliamcommented, May 1, 2023

I’ve asked the team to dive into this.

Read more comments on GitHub >

github_iconTop 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 >

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