angular / angular/components

bug(MatMenu): dropdown with menu items pops over menu trigger when there's a scroll bar in the dropdown

未关闭
#19,609 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area: material/menu P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### Reproduction

Steps to reproduce:
1. Go to the following StackBlitz URL https://stackblitz.com/edit/angular-xcgrfw
2. Click on the "Menu" button
3. Notice how menu items pop over the "Menu" button



#### Expected Behavior

The expected behaviour is for the menu dropdown to be positioned below the "Menu" button regardless of the number of menu items as in the following example https://stackblitz.com/angular/mnygrqvpejk?file=src%2Fapp%2Fmenu-overview-example.ts

#### Actual Behavior

The dropdown with menu items pops over the "Menu" button when there's so many menu items that the menu becomes scrollable

#### Environment

- Angular: 9.1.11
- CDK/Material: 9.2.4
- Browser(s): Google Chrome 83.0.4103.97
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

贡献指南

打开贡献指南

调研方向

首先使用链接的 StackBlitz 示例重现该问题,然后将其 MatMenu 行为与链接的 Angular 菜单示例进行比较。跟踪负责可滚动 dropdown 的菜单定位入口点,并验证当 dropdown 包含足够多、需要滚动的项目时,它仍保持在 trigger 下方。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。