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.

Inline Hyperlink does not work when IsTextSelectionEnabled="True"

See original GitHub issue

Describe the bug

When using a Hyperlink in a TextBlock, and IsTextSelectionEnabled=“True”, clicking the hyperlink does nothing. This is a regression in Windows App SDK 1.x.x. It works in Windows App SDK 0.8

Steps to reproduce the bug

  1. Use Windows App SDK 1.x.x
  2. Use this XAML:
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Left" VerticalAlignment="Top">
    <TextBlock.Inlines>
       <Hyperlink Click="OnHyperlinkClick">
            <Hyperlink.Inlines>
                <Run Text="Click Me!"/>
            </Hyperlink.Inlines>
         </Hyperlink>
    </TextBlock.Inlines>
</TextBlock>
  1. Click the hyperlink (Click Me!)

The OnHyperlinkClick handler is never fired as long as text selection is enabled.

Expected behavior

It should be possible to click on a hyperlink in a TextBlock, even when text selection is enabled.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.x.x

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wbokkerscommented, Nov 23, 2022

🎉🎈😃 This issue has been resolved in Windows App SDK 1.2

0reactions
gabbybilkacommented, Dec 12, 2022

Closing as per @wbokkers message and tweet confirming it was resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hyperlinks not working in inline paragraph text
Hiya, I'm a newb so this is probably painfully obvious but my outbound hyperlinks aren't working. On the editor side, it couldn't be...
Read more >
Inline Hyperlinks not working as expected - Inform 7
I'm using Inform 7 6L38, and Erik Temple's Inline Hyperlinks. I don't know whether it's because I'm tired and have missed part of...
Read more >
Stop hyperlink inheriting div's width? - css
It's sort of a mix between the two. The clear attribute stops the inline floating and goes back to normal block behavior (new...
Read more >
Hyperlinking a piece of text in Excel
I think Excel does not allow creating hyperlinks on only part of the text in a cell. The hyperlink can only be set...
Read more >
Markdown link not being rendered as a hyperlink?
The problem was due to an invisible character in the end of the link URL. Here is the revision history of this answer: ......
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