microsoft / microsoft/microsoft-ui-xaml

Caret Browsing causes app to crash on TextBlock with links

Open
#10,764 2 comments 0 reactions 0 assignees View on GitHub
bug needs-repro needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

If Caret Browsing is enabled (by pressing F7) the app will crash whenever the user tabs on a `(Rich)TextBlock` if it contains any `Hyperlink` and `IsTextSelectionEnabled` is set to false.

### Why is this important?

Makes apps hard to use for screen reader users.
This currently accounts for more than 2.5% of crashes in my app.

### Steps to reproduce the bug

1. Add a `TextBlock` with a `Hyperlink` to a `Window`
2. Enable Caret Browsing by pressing F7
3. Tab to focus the `TextBlock`

### Actual behavior

_No response_

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

None

### Windows version

_No response_

### Additional context

This is a quite ancient bug, happens on UWP since a very long time. WinUI 3 is affected too.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash with a (Rich)TextBlock containing a Hyperlink, IsTextSelectionEnabled set to false, Caret Browsing enabled, and focus moved with Tab. Trace the TextBlock/Hyperlink focus path and add a regression test covering this sequence; done means tabbing to the control no longer crashes and caret browsing remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
accessibility, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.