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

Method _expandOrFirstChild

src/aria/private/tree/tree.ts:461–468  ·  view source on GitHub ↗

Expands the active item if possible, otherwise navigates to the first child.

(opts?: SelectOptions)

Source from the content-addressed store, hash-verified

459
460 /** Expands the active item if possible, otherwise navigates to the first child. */
461 _expandOrFirstChild(opts?: SelectOptions) {
462 const item = this.treeBehavior.inputs.activeItem();
463 if (item && this.treeBehavior.isExpandable(item) && !item.expanded()) {
464 this.treeBehavior.expand(item);
465 } else {
466 this.treeBehavior.firstChild(opts);
467 }
468 }
469
470 /** Collapses the active item if possible, otherwise navigates to the parent. */
471 _collapseOrParent(opts?: SelectOptions) {

Callers 1

TreePatternClass · 0.95

Calls 5

activeItemMethod · 0.80
expandedMethod · 0.80
firstChildMethod · 0.80
expandMethod · 0.65
isExpandableMethod · 0.45

Tested by

no test coverage detected