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

Method closeAll

src/aria/private/menu/menu.ts:460–474  ·  view source on GitHub ↗

Closes the menu and all parent menus.

()

Source from the content-addressed store, hash-verified

458
459 /** Closes the menu and all parent menus. */
460 closeAll() {
461 const root = this.root();
462
463 if (root instanceof MenuTriggerPattern) {
464 root.close({refocus: true});
465 }
466
467 if (root instanceof MenuBarPattern) {
468 root.close();
469 }
470
471 if (root instanceof MenuPattern) {
472 root.inputs.activeItem()?.close({refocus: true});
473 }
474 }
475
476 /** Clears any open or close timeouts for sub-menus. */
477 _clearTimeouts() {

Callers 2

MenuPatternClass · 0.95
collapseAllMethod · 0.45

Calls 2

activeItemMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected