microsoft / microsoft/microsoft-ui-xaml

TreeView children nodes at the same depth from the parent [Live Visual Tree] [Narrator] [NVDA]

Open
#10,483 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-TreeView bug
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.
Image

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:
Image

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
  1. Download and install NVDA from https://www.nvaccess.org/download/
  2. Open the TreeView example in WinUI 3 Gallery
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.