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

Method collapse

src/aria/private/menu/menu.ts:411–420  ·  view source on GitHub ↗

Collapses the current menu or focuses the previous item in the menubar.

()

Source from the content-addressed store, hash-verified

409
410 /** Collapses the current menu or focuses the previous item in the menubar. */
411 collapse() {
412 const root = this.root();
413 const parent = this.inputs.parent();
414
415 if (parent instanceof MenuItemPattern && !(parent.inputs.parent() instanceof MenuBarPattern)) {
416 parent.close({refocus: true});
417 } else if (root instanceof MenuBarPattern) {
418 root.prev();
419 }
420 }
421
422 /** Expands the current menu or focuses the next item in the menubar. */
423 expand() {

Callers 1

MenuPatternClass · 0.95

Calls 3

parentMethod · 0.80
closeMethod · 0.45
prevMethod · 0.45

Tested by

no test coverage detected