Skip to content

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

@FernandoVeras

Description

@FernandoVeras

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions