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

Method _resolvePanel

src/material/menu/menu.ts:524–536  ·  view source on GitHub ↗

Gets the menu panel DOM node.

()

Source from the content-addressed store, hash-verified

522
523 /** Gets the menu panel DOM node. */
524 private _resolvePanel(): HTMLElement | null {
525 let menuPanel: HTMLElement | null = null;
526
527 if (this._directDescendantItems.length) {
528 // Because the `mat-menuPanel` is at the DOM insertion point, not inside the overlay, we don't
529 // have a nice way of getting a hold of the menuPanel panel. We can't use a `ViewChild` either
530 // because the panel is inside an `ng-template`. We work around it by starting from one of
531 // the items and walking up the DOM.
532 menuPanel = this._directDescendantItems.first!._getHostElement().closest('[role="menu"]');
533 }
534
535 return menuPanel;
536 }
537}

Callers 2

focusFirstItemMethod · 0.95
_setIsOpenMethod · 0.95

Calls 1

_getHostElementMethod · 0.45

Tested by

no test coverage detected