Skip to content

Headless Tree doesn't set aria-expanded attribute #171

@gordey4doronin

Description

@gordey4doronin

Describe the bug
Headless Tree doesn't set aria-expanded attribute correspondingly for expanded/collapsed folder items.

To Reproduce
Simply use any storybook example such as https://headless-tree.lukasbach.com/storybook/react/?path=/story/react-general-example--example.

Expand a tree item and check the attributes.

Expected behavior
According to W3C https://www.w3.org/WAI/ARIA/apg/patterns/treeview/#examples:

Each element with role treeitem that serves as a parent node has aria-expanded set to false when the node is in a closed state and set to true when the node is in an open state. End nodes do not have the aria-expanded attribute because, if they were to have it, they would be incorrectly described to assistive technologies as parent nodes.

Screenshots
Image

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions