Gets the menu panel DOM node.
()
| 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 | } |
no test coverage detected