Skip to content

tree: invalid for a role=tree to not have any treeitems in the DOM #13458

Open
@Splaktar

Description

@Splaktar

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The Tree component would pass a11y audits out of the box.

What is the current behavior?

Using the current Tree schematic as an example
screen shot 2018-10-05 at 5 30 29 pm

The DOM includes no elements with role="treeitem". This isn't valid.
screen shot 2018-10-05 at 5 30 10 pm

What are the steps to reproduce?

https://material.angular.io/components/tree/examples
https://beta-angular-material-io.firebaseapp.com/components/tree/examples

What is the use-case or motivation for changing an existing behavior?

screen shot 2018-10-05 at 5 28 19 pm

https://dequeuniversity.com/rules/axe/2.2/aria-required-children?application=lighthouse
https://www.w3.org/TR/wai-aria/#tree

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 6.0.9, 7.0.0-rc.0
Material: 6.4.7, 7.0.0-rc.0
TypeScript: 2.7.2, 3.1.1
Browsers: Chrome, but assumed to affect all

Is there anything else we should know?

The tree becomes valid and passes the audit as soon as it is expanded to a leaf node which will be a role="treeitem".

This issue means that the tree Schematic will generation code that does not pass an a11y audit by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/treeneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions