angular / angular/components

bug(Select): Select menu height shrinks when scrolling

Đang mở
#30,901 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/select P4
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và theo dõi component Select trong khi cuộn trang với menu đang mở. So sánh chiều cao của menu khi nó rời khỏi và quay lại viewport; hoàn tất có nghĩa là chiều cao lại mở rộng sau khi cuộn trở lại để menu hiển thị, như được mô tả trong hành vi mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.