angular / angular/components

bug(Select): Select menu height shrinks when scrolling

Ouverte
#30,901 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: material/select P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et suivez le composant Select tout en faisant défiler la page avec le menu ouvert. Comparez la hauteur du menu lorsqu’il quitte la fenêtre d’affichage et y revient ; c’est terminé lorsque la hauteur s’agrandit à nouveau après avoir fait défiler la page pour le rendre à nouveau visible, comme décrit dans le comportement attendu.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.