microsoft / microsoft/microsoft-ui-xaml
RichTextBlock with inline hyperlink fails Accessibility Insights Tool test when hyperlink isn't visible
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
I have a RichTextBlock with hyperlink inside a ScrollViewer. The IsOffscreen property of that hyperlink isn't updated properly when the hyperlink is out of view.
It makes Accessibility Insights Tool fail with "An on-screen element must not have a null BoundingRectangle property."
### Why is this important?
This issue may cause a confusion for users depending on this accessibility feature when there's a hyperlink in the RichTextBlock content
### Steps to reproduce the bug
[TextBlockHyperlinkIssue.zip](https://github.com/user-attachments/files/24909085/TextBlockHyperlinkIssue.zip)
1a. Make a new project using WinUI template and add following structure, for example in MainWindow.xaml:
```
Text long enough to hide the hyperlink below ...
some link
```
1b. Use attached example project
2. Start the app
3. Make sure the hyperlink isn't visible in the app window
4. Start Accessibility Insights Tool
5. Run automated checks on the app
### Actual behavior
Automated check finds a failure on the hyperlink: "An on-screen element must not have a null BoundingRectangle property."
### Expected behavior
Accessibility test shouldn't fail
### Screenshots
Failing, hyperlink not visible:
Passing, hyperlink visible:
### NuGet package version
WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
Research direction
Start with the attached reproduction project and the RichTextBlock, ScrollViewer, and Hyperlink structure described in the issue. Compare the hyperlink's automation properties when it is visible versus scrolled out of view, then run Accessibility Insights automated checks; done means the hidden hyperlink no longer triggers the null BoundingRectangle failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- accessibility, desktop, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100