angular / angular/components

bug(Select): Select menu height shrinks when scrolling

Aperta
#30,901 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
area: material/select P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata e segui il componente Select mentre scorri la pagina con il menu aperto. Confronta l'altezza del menu quando esce dal viewport e vi rientra; il lavoro è completato quando l'altezza si espande nuovamente dopo essere tornato a scorrere fino a renderlo visibile, come descritto nel comportamento previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.