Skip to content

docs(material/tree): set isExpandable on expandable nodes in examples - #34229

Open
noahoye wants to merge 7 commits into
angular:mainfrom
noahoye:docs-tree-is-expandable
Open

noahoye wants to merge 7 commits into
angular:mainfrom
noahoye:docs-tree-is-expandable

Conversation

@noahoye

@noahoye noahoye commented Dec 4, 2026

Copy link
Copy Markdown

tree.md says isExpandable must be set on expandable nodes, but six Material examples
(nested-overview, nested-child-accessor-overview, flat-overview, flat-child-accessor-overview,
tree-dynamic, tree-loadmore) didn't set it. Clicking the toggle still worked, but the nodes had
no aria-expanded and ArrowRight/ArrowLeft did nothing. The CDK examples and the remaining
Material examples already set it or use a treeControl.

Verified in Chromium against @angular/material 22.3.2: ArrowRight expands and then moves to the
first child, ArrowLeft moves to the parent and then collapses, aria-expanded is present. This
includes the dynamic and load-more examples (children loaded after expansion; the "load more"
node is not marked expandable). Not tested in Firefox.

Relates to #32465 (item 2). The toggle button being in the tab order is fixed separately in
#34228.

The tree examples that don't use a `treeControl` didn't set `isExpandable` on their expandable
nodes. Without it the nodes have no `aria-expanded` and the arrow keys don't expand or collapse
them, because the key manager only expands nodes that are marked as expandable.

Relates to angular#32465.
@angular-robot angular-robot Bot added area: docs Related to the documentation area: material/tree labels Dec 4, 2026
@pullapprove
pullapprove Bot requested review from crisbeto and ok7sai December 4, 2026 16:36

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

area: docs Related to the documentation area: material/tree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant