Skip to content

mat menu not working correctly when two triggers are used for same mat-menu #15354

Closed
@lokeshdaiya

Description

@lokeshdaiya

What is the expected behavior?

I am using mat menu without backdrop.
I am trying to open mat-menu with two different triggers
When we click on triggers it should close and open mat menu correctly.

What is the current behavior?

  1. When I click on first trigger button it opens mat menu
  2. When I click on second trigger it opens mat-menu
  3. When I again click on first trigger it doesn't open mat-menu
  4. Again if click on first trigger then it will open mat-menu

What are the steps to reproduce?

Have a look on below stackblitz
https://stackblitz.com/edit/angular-yvk7bv

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 7+

Is there anything else we should know?

I checked in DOM when I click on first trigger button it adds div with class cdk-overlay-connected-position-bounding-box, when I click on second trigger again it adds one more div with same class.

It seems it is not destroying properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/menu

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions