microsoft / microsoft/microsoft-ui-xaml
TreeView children nodes at the same depth from the parent [Live Visual Tree] [Narrator] [NVDA]
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
Describe the bug
TreeView children nodes have the same depth from the parent during construction.
We can observe this behavior using Live Visual Tree in Visual Studio.
For user interaction, this is mostly insignificant, but it causes issues with accessibility.
When using a screen reader like NVDA (https://www.nvaccess.org/download/), the tool always reads nodes as being at the same depth (level) from one another. We never get a child node at level 2 in relation to its parent—it’s always level 1.
See this example below:
This bug can be reproduced in both WinUI 3 Gallery and WinUI 2 Gallery.
Additionally, as developers, we face problems when trying to customize and animate the TreeView, because:
- All children appear at the same depth as their parent.
- We cannot directly determine which child belongs to which parent.
- We cannot animate the Container properly, since there is no clear parent-children structure to reference.
Steps to reproduce the bug
- Download and install NVDA from https://www.nvaccess.org/download/
- Open the TreeView example in WinUI 3 Gallery
- Launch NVDA and navigate (tab) through the TreeView example
Note: You can also reproduce this by:
- Creating a WinUI project in Visual Studio
- Using Microsoft's standard TreeView control to simulate the issue
Expected behavior
Each expandable item in the TreeView should:
- Be a proper container element
- Contain its child nodes within its hierarchy
- Create a true multi-level component structure
This would enable:
✔️ Correct accessibility tree representation (with proper nesting levels)
✔️ Accurate screen reader announcements of hierarchy depth
✔️ Proper container targeting for animations and styling
✔️ Clear parent-child relationships in the visual tree
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.7.0: 1.7.250310001
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the WinUI 3 Gallery TreeView with NVDA, and compare the visual and accessibility hierarchies described in the report. Investigate how expandable items expose their child nodes during construction. Done means child nodes have correct parent-child nesting and screen readers announce accurate hierarchy levels.
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