angular / angular/components

bug(Select): Select menu height shrinks when scrolling

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

描述

### Is this a regression?

- [x] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When select menu is opened and scrolled out of view it's height becomes really small. When scrolling back into view the height never increases and stays small.

This issue is similar to already fixed issue in mat-menu component
https://github.com/angular/components/issues/18168
https://github.com/angular/components/pull/21436

### Reproduction

StackBlitz link: https://stackblitz.com/edit/zdrajstd?file=src%2Fexample%2Fselect-custom-trigger-example.html
Steps to reproduce:
1. Create a page large enough where you can scroll
2. Add a select component with a few options in the middle of the page
3. Scroll through the page while the select is open

### Expected Behavior

Select menu height should increase when scrolled back into view

### Actual Behavior

Select menu height doesn't increase and stays small.

![Image](https://github.com/user-attachments/assets/46a83001-4e12-4891-82c1-1742217bda1f)

### Environment

- Angular: 19.2.7,
- CDK/Material: 19.2.10
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,在菜单打开时滚动页面并跟踪 Select 组件。比较菜单离开视口并重新进入视口时的高度;完成的标准是,按照预期行为中的描述,滚动回到视口后高度再次展开。

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

评估

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

把新 issue 发到你的邮箱

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