MCPcopy Create free account
hub / github.com/angular/components / collapse

Method collapse

src/aria/private/menu/menu.ts:431–440  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

429
430 /** Collapses the current menu or focuses the previous item in the menubar. */
431 collapse() {
432 const root = this.root();
433 const parent = this.inputs.parent();
434
435 if (parent instanceof MenuItemPattern && !(parent.inputs.parent() instanceof MenuBarPattern)) {
436 parent.close({refocus: true});
437 } else if (root instanceof MenuBarPattern) {
438 root.prev();
439 }
440 }
441
442 /** Expands the current menu or focuses the next item in the menubar. */
443 expand() {

Callers 1

MenuPatternClass · 0.95

Calls 3

parentMethod · 0.80
closeMethod · 0.45
prevMethod · 0.45

Tested by

no test coverage detected