question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Mat Menu does not open.

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Mat Menu opens

What is the current behavior?

Mat Menu does not open

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

@angular-devkit/architect 0.8.6 @angular-devkit/build-angular 0.8.6 @angular-devkit/build-optimizer 0.8.6 @angular-devkit/build-webpack 0.8.6 @angular-devkit/core 0.8.6 @angular-devkit/schematics 0.8.6 @angular/cdk 6.4.7 @angular/cli 6.2.6 @angular/flex-layout 6.0.0-beta.18 @angular/material 6.4.7 @ngtools/webpack 6.2.6 @schematics/angular 0.8.6 @schematics/update 0.8.6 rxjs 6.3.3 typescript 2.9.2 webpack 4.22.0

Tested both in latest Firefox, and latest Chrome.

Is there anything else we should know?

Only started happening since I updated to 6.4.7 on cdk and material. Code:

<button class="portal-user-menu-button" mat-button [matMenuTriggerFor]="userDetailsMenu">
  <img class="portal-user-menu-button__avatar" src="assets/images/layouts/avatar.png" alt="Moderator">
  <span class="portal-user-menu-button__username">{{username}}</span>
</button>
<mat-menu #userDetailsMenu="matMenu" classList="portal-menu-no-padding">
  <div class="portal-user-menu-header" fxLayout="row" fxLayoutAlign=" center">
    <img class="portal-user-menu-header__avatar" src="assets/images/layouts/avatar.png" alt="Moderator"/>
    <div class="portal-user-menu-header__details" fxLayout="column" fxLayoutAlign="center start">
      <h2>{{username}}</h2>
    </div>
  </div>
  <mat-nav-list class="portal-user-menu-list">
    <a mat-list-item (click)="logout()">
      <mat-icon matListIcon>exit_to_app</mat-icon>
      <span i18n>Sign Out</span>
    </a>
  </mat-nav-list>
</mat-menu>

Gif: peek 2018-10-31 10-25

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JethroWorkcommented, Mar 6, 2019

I have the same problem. After the check, my solution is to import the BrowserAnimationsModule.

app.module.ts import { BrowserAnimationsModule } from ‘@angular/platform-browser/animations’;

imports: [ BrowserModule, AppRoutingModule , MatButtonModule , MatMenuModule , MatIconModule , BrowserAnimationsModule // Browser Animation, Must for pop-up menu ],

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to open and close Angular mat menu on hover
Hover the mouse cursor on the button and the menu will pop up. But if you click on the button, it will hide...
Read more >
Table | Angular Material
UI component infrastructure and Material Design components for mobile and desktop Angular web applications.
Read more >
A seamless guide on Angular Material Menu Component
The mat-menu is a directive that is used to trigger the menu options when the button click event is triggered because it cannot...
Read more >
Angular Material Open Menu Programmatically - StackBlitz
Stackoverflow demo - cannot open menu progammatically. ... import { MatMenuTrigger } from '@angular/. material/menu';. @Component({. selector: 'my-app',.
Read more >
React Menu component - Material UI - MUI
Although they can display the same content, simple menus are preferred over ... However, you might want to use a different positioning strategy,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found