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

Function _menuClosingActions

src/material/menu/menu-trigger-base.ts:454–465  ·  view source on GitHub ↗

Returns a stream that emits whenever an action that should close the menu occurs.

()

Source from the content-addressed store, hash-verified

452
453 /** Returns a stream that emits whenever an action that should close the menu occurs. */
454 private _menuClosingActions() {
455 const outsideClicks = this._getOutsideClickStream(this._overlayRef!);
456 const detachments = this._overlayRef!.detachments();
457 const parentClose = this._parentMaterialMenu ? this._parentMaterialMenu.closed : observableOf();
458 const hover = this._parentMaterialMenu
459 ? this._parentMaterialMenu
460 ._hovered()
461 .pipe(filter(active => this._menuOpen && active !== this._menuItemInstance))
462 : observableOf();
463
464 return merge(outsideClicks, parentClose as Observable<MenuCloseReason>, hover, detachments);
465 }
466
467 /** Gets the portal that should be attached to the overlay. */
468 private _getPortal(menu: MatMenuPanel): TemplatePortal {

Callers

nothing calls this directly

Calls 3

detachmentsMethod · 0.80
_hoveredMethod · 0.80

Tested by

no test coverage detected