Skip to content

[TreeView] Add an explicit aria-label to SubTree ul elements for Safari VoiceOver support #5035

Description

@strackoverflow

Description

This came up from an accessibility audit of one of our internal components which makes use of TreeView. (GitHub staff link for more context: https://github.com/github/collaboration-workflows-flex/issues/1190).

It looks like the TreeView.SubTree component needs an aria-label on its ul element in order for Safari's VoiceOver screenreader to properly describe the nested list. This label should just be equivalent to the parent item's accessible name.

This seems like something we could automatically set on all SubTrees so they are VoiceOver compatible, but if there's some reason why we wouldn't want to do this across the board, we could at least add a prop to pass in an aria-label to the SubTree. I'm curious to hear if there's an opinion one way or the other on that 🤔

Steps to reproduce

  1. Create a nested sub-tree at least 3 levels deep
  2. When navigating to the first child item of the nested parent item, VoiceOver reads the text of the parent item, not the focused item

Version

v36.27.0

Browser

Safari

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions