Skip to content

feat: Add ariaRole property to tree view - #5333

Open
jorycunningham wants to merge 1 commit into
cloudscape-design:mainfrom
jorycunningham:feat/tree-view-aria-role
Open

jorycunningham wants to merge 1 commit into
cloudscape-design:mainfrom
jorycunningham:feat/tree-view-aria-role

Conversation

@jorycunningham

Copy link
Copy Markdown
Contributor

Adds ariaRole ('tree' | 'list', default 'tree') to TreeView. Closes #5326

  • tree keeps the current tree widget semantics and keyboard navigation.
  • list renders nested lists: no tree, treeitem or group roles, no aria-expanded or aria-level on items, and no roving tabindex, so expand toggles and item actions are in the normal tab order. The list and listitem roles are set explicitly because Safari drops list semantics from lists styled with list-style: none.

Tested in demo page using a screen reader

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • X Changes include appropriate documentation updates._
  • X Changes are backward-compatible if not indicated, see CONTRIBUTING.md._
  • X Changes do not include unsupported browser features, see CONTRIBUTING.md._
  • X Changes were manually tested for accessibility, see accessibility guidelines._

Security

Testing

  • X Changes are covered with new/existing unit tests?_
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Adds `ariaRole` ('tree' | 'list', default 'tree') to TreeView.

- `tree` keeps the current tree widget semantics and keyboard navigation.
- `list` renders nested lists: no tree, treeitem or group roles, no
  aria-expanded or aria-level on items, and no roving tabindex, so expand
  toggles and item actions are in the normal tab order. The `list` and
  `listitem` roles are set explicitly because Safari drops list semantics
  from lists styled with `list-style: none`.
@jorycunningham
jorycunningham requested a review from a team as a code owner November 19, 2026 16:51
@jorycunningham
jorycunningham requested review from ernst-dev and removed request for a team November 19, 2026 16:51

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support TreeView semantic override for structured lists

1 participant