A
A
Alena Khrenovskaya2018-05-08 14:10:05
Angular
Alena Khrenovskaya, 2018-05-08 14:10:05

How to make mat-menu (angular/material) menu be lower?

We have: Q3noNTPCoJU.jpg
code:

<nav mat-tab-nav-bar class="system-bar">
    <a mat-tab-link [routerLink]="['/system', 'jobs']" class="system-button"> All jobs </a>
    <a mat-tab-link [routerLink]="['/system', 'contracts']" class="system-button"> Your contracts </a>
    <a mat-tab-link [matMenuTriggerFor]="menu" class="user-menu"> Здравствуйте, {{user.username}}</a>
    <mat-menu #menu>
      <button mat-menu-item="" class="system-button" (click)="onLogout()">Выход</button>
    </mat-menu>
  </nav>

How to make the menu not so ugly and creep out from below?)) The direction property does not help. It's about the dropdown menu.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Stroykin, 2018-05-08
@ally69

To do this, use [overlapTrigger]="false"
Code example:

<button mat-button [matMenuTriggerFor]="menu">Menu</button>
<mat-menu #menu="matMenu" [overlapTrigger]="false">
    <button mat-menu-item>Item 1</button>
    <button mat-menu-item>Item 2</button>
</mat-menu>

An example of a finished implementation:
5af18ebbb53e3294981659.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question