-
Notifications
You must be signed in to change notification settings - Fork 803
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.
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
