MCPcopy Index your code
hub / github.com/angular/components / _collapseOrParent

Method _collapseOrParent

src/aria/private/tree/tree.ts:471–478  ·  view source on GitHub ↗

Collapses the active item if possible, otherwise navigates to the parent.

(opts?: SelectOptions)

Source from the content-addressed store, hash-verified

469
470 /** Collapses the active item if possible, otherwise navigates to the parent. */
471 _collapseOrParent(opts?: SelectOptions) {
472 const item = this.treeBehavior.inputs.activeItem();
473 if (item && this.treeBehavior.isExpandable(item) && item.expanded()) {
474 this.treeBehavior.collapse(item);
475 } else {
476 this.treeBehavior.parent(opts);
477 }
478 }
479
480 /** Retrieves the TreeItemPattern associated with a DOM event, if any. */
481 protected _getItem(event: Event): TreeItemPattern<V> | undefined {

Callers 1

TreePatternClass · 0.95

Calls 5

activeItemMethod · 0.80
expandedMethod · 0.80
parentMethod · 0.80
collapseMethod · 0.65
isExpandableMethod · 0.45

Tested by

no test coverage detected