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

Function _createOverlay

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

* This method creates the overlay from the provided menu's template and saves its * OverlayRef so that it can be attached to the DOM when openMenu is called.

(menu: MatMenuPanel)

Source from the content-addressed store, hash-verified

339 * OverlayRef so that it can be attached to the DOM when openMenu is called.
340 */
341 private _createOverlay(menu: MatMenuPanel): OverlayRef {
342 if (!this._overlayRef) {
343 const config = this._getOverlayConfig(menu);
344 this._subscribeToPositions(
345 menu,
346 config.positionStrategy as FlexibleConnectedPositionStrategy,
347 );
348 this._overlayRef = createOverlayRef(this._injector, config);
349 this._overlayRef.keydownEvents().subscribe(event => {
350 if (this._menu instanceof MatMenu) {
351 this._menu._handleKeydown(event);
352 }
353 });
354 }
355
356 return this._overlayRef;
357 }
358
359 /**
360 * This method builds the configuration object needed to create the overlay, the OverlayState.

Callers

nothing calls this directly

Calls 4

createOverlayRefFunction · 0.90
_getOverlayConfigMethod · 0.45
keydownEventsMethod · 0.45
_handleKeydownMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…