microsoft / microsoft/microsoft-ui-xaml
Screen reader doesn't announce 'Open/Close' state on for NavigationView in Xaml Islands
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
In a XAML Islands app, the open/close button for the NavigationView doesn't announce its state.
This issue was originally reported on Windows Terminal in https://github.com/microsoft/terminal/issues/19687. That bug was filed by the accessibility team. I've tested this scenario in several cases:
- WinUI 3: no repro
- WinUI 2 gallery: no repro
- XAML Islands: repro (tested via Scratch.slnx project in Terminal repo; this project is intended to be a simple way to test things in XAML Islands for our app)
### Why is this important?
Screen reader users cannot determine whether the navigation panel is open or closed, leading to confusion and difficulty in navigating the interface. This impacts efficiency and independence.
### Steps to reproduce the bug
1. Turn on Narrator using Ctrl+Win+Enter
2. Open a XAML Islands app with a NavigationView
3. Move focus to the open/close button of the navigation view
4. Invoke it using Space/Enter
### Actual behavior
When the user activates the 'Open/Close' navigation button, the screen reader remains silent. It does not announce whether the navigation panel is open or closed. The button label is announced only when it receives keyboard focus for the first time.
I've also found that Space and Enter are read out differently.
### Expected behavior
The 'Open/Close' navigation button should programmatically expose its state (open or closed) using appropriate ARIA attributes (e.g., aria-expanded="true" or aria-expanded="false") so that assistive technologies announce the state change when the button is activated.
### Screenshots
Attachments from https://github.com/microsoft/terminal/issues/19687:
https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-heparihar_microsoft_com/IQDLd9wWKN2AQ5st84Yv_lwwAXMfAiE1AuV8JoNjoRTKxW0?e=pQZpOf
### NuGet package version
None
### Windows version
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the issue with Narrator in the Terminal repository's Scratch.slnx XAML Islands project, focusing on the NavigationView open/close button. Compare its behavior with the WinUI 3 and WinUI 2 gallery cases described in the report. Done means activating the button causes the screen reader to announce whether the navigation panel is open or closed.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100