microsoft / microsoft/microsoft-ui-xaml
Using Narrator can crash the app when adding a creating RichTextBlock dynamically contaning Hyperlink, and assign it to a ContentControl
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Crashes
Exception code: 0xc000041d
Faulting module path: C:\WINDOWS\SYSTEM32\uiautomationcore.dll
And
Exception code: 0xc0000005
Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.8_8000.642.119.0_x648wekyb3d8bbwe\Microsoft.UI.Xaml.dll
```
public static UIElement GetFormattedMessage(string inputMessage) {
var rtBlock = new RichTextBlock
{
FontSize = 14,
MaxLines = 1 ,
TextTrimming = TextTrimming.CharacterEllipsis ,
IsTextSelectionEnabled = false
};
var para = new Paragraph();
Run run = new Run();
run.Text = inputMessage;
para.Inlines.Add(run);
para.Inlines.Add(new Hyperlink());
rtBlock.Blocks.Add(para);
return rtBlock;
}
```
Sample POC to repro this bug: [Git hub repo link](https://github.com/Harsini23/WinUINarratorCrashPOC/tree/main)
### Why is this important?
app crashes in using microsoft.windowsappsdk version - 1.8.251003001
### Steps to reproduce the bug
Launch Narrator. Scan mode
Navigate to the TextBlock element 2-3 times and try to navigate with tab - up/down arrow keys, app crashes
### Actual behavior
App crashes
### Expected behavior
App should not crash
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.8.2: 1.8.251003001
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
related issue references - [previous issue](https://github.com/microsoft/microsoft-ui-xaml/issues/7319?utm_source=chatgpt.com)
Contributor guide
Research direction
Start with the linked WinUI Narrator crash POC and reproduce the failure on Windows 11 with Windows App SDK 1.8.2, using Narrator scan mode and keyboard navigation. Read the referenced previous issue for related context; done means the dynamic RichTextBlock and ContentControl scenario no longer crashes while navigating with Narrator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- accessibility, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100