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

Method closeAll

src/aria/private/menu/menu.ts:453–467  ·  view source on GitHub ↗

Closes the menu and all parent menus.

()

Source from the content-addressed store, hash-verified

451
452 /** Closes the menu and all parent menus. */
453 closeAll() {
454 const root = this.root();
455
456 if (root instanceof MenuTriggerPattern) {
457 root.close({refocus: true});
458 }
459
460 if (root instanceof MenuBarPattern) {
461 root.close();
462 }
463
464 if (root instanceof MenuPattern) {
465 root.inputs.activeItem()?.close({refocus: true});
466 }
467 }
468
469 /** Clears any open or close timeouts for sub-menus. */
470 _clearTimeouts() {

Callers 2

MenuPatternClass · 0.95
collapseAllMethod · 0.45

Calls 2

activeItemMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected