Within my mat-menu, there is a div for each mat-menu item. The number of items varies depending on the data retrieved.
However, I noticed that when there are more items than can fit in the menu, it extends beyond the boundaries of the mat-menu instead of displaying a vertical scrollbar as expected.
I attempted to address this issue by setting a max-height
for the mat-menu-item
with overflow: auto
, but this solution did not work.
This is how it currently appears:
https://i.sstatic.net/EjjWU.png
Here is the snippet of my HTML and CSS:
<mat-menu #emailOptionsMenu="matMenu" xPosition="before">
<div class="dropdown_item" *ngFor="let user of filteredUsers">
{{user}}
</div>
</mat-menu>
.dropdown_item {
padding: 6px 20px;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
}
What steps should I take to resolve this issue?