Skip to content

bug(menu): panel class does not work. #26815

@liesahead

Description

@liesahead

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

V14

Description

Panel class for the menu is not set anywhere

image

image

Here's the menu content html with .mat-mdc-menu-panel

<div tabindex="-1" role="menu" class="mat-mdc-menu-panel mdc-menu-surface mdc-menu-surface--open mat-mdc-elevation-specific ng-trigger ng-trigger-transformMenu ng-tns-c62-0 mat-menu-below mat-elevation-z8 ng-star-inserted mat-menu-before" id="mat-menu-panel-0" ng-reflect-ng-class="[object Object]" style="transform-origin: right top;"><div class="mat-mdc-menu-content mdc-list ng-tns-c62-0"><button _ngcontent-sbf-c65="" mat-menu-item="" class="mat-mdc-menu-item mat-mdc-focus-indicator mdc-list-item ng-tns-c62-0" role="menuitem" tabindex="0" aria-disabled="false"><span class="mdc-list-item__primary-text"><span _ngcontent-sbf-c65="" class="language-content"><img _ngcontent-sbf-c65="" src="https://upload.wikimedia.org/wikipedia/commons/1/11/Flag_of_Lithuania.svg" height="15"><span _ngcontent-sbf-c65="">LT</span></span></span><div matripple="" class="mat-ripple mat-mdc-menu-ripple" ng-reflect-disabled="false" ng-reflect-trigger="[object HTMLButtonElement]"></div><!--bindings={
  "ng-reflect-ng-if": "false"
}--></button><button _ngcontent-sbf-c65="" mat-menu-item="" class="mat-mdc-menu-item mat-mdc-focus-indicator mdc-list-item ng-tns-c62-0" role="menuitem" tabindex="0" aria-disabled="false"><span class="mdc-list-item__primary-text"><span _ngcontent-sbf-c65="" class="language-content"><img _ngcontent-sbf-c65="" src="https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_United_Kingdom_%283-5%29.svg" height="15"><span _ngcontent-sbf-c65="">EN</span></span></span><div matripple="" class="mat-ripple mat-mdc-menu-ripple" ng-reflect-disabled="false" ng-reflect-trigger="[object HTMLButtonElement]"></div><!--bindings={
  "ng-reflect-ng-if": "false"
}--></button></div></div>

Reproduction

Steps to reproduce:

  1. Set panelClass on menu
  2. See that it doesn't apply anywhere.

Expected Behavior

Panel class should apply on mat-mdc-menu-panel element.

Actual Behavior

It does not.

Environment

Angular CLI: 15.2.2
Node: 18.14.0
Package Manager: yarn 3.3.0
OS: win32 x64

Angular: 15.2.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.1502.2
@angular-devkit/build-angular 15.2.2
@angular-devkit/core 15.2.2
@angular-devkit/schematics 15.2.2
@schematics/angular 15.2.2
rxjs 7.8.0
typescript 4.9.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions