angular / angular/components

bug(select[matNativeControl]): Sometimes the options are not triggered

Aperta
#27,682 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
area: material/select P2
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

prior to mdc migration

### Description

when using `select[matNativeControl]` inside `` there's a couple of problems:

1. when using an empty string as the default option, the label appears within the form field. directly clicking the label does not trigger the options.
2. clicking just inside `mat-form-field` (inside the outline) also does not trigger the options

### Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-r49x2i?file=src%2Fapp%2Fexample-component.html
Steps to reproduce:
1. click the label while it's within the form field
2. also click just inside the bounds of the form field

### Expected Behavior

triggers the options

### Actual Behavior

options are not triggered - label just moves up

### Environment

- Angular: 16.1.2
- CDK/Material: 16.1.3
- Browser(s): chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e dall’interazione tra select[matNativeControl] e mat-form-field appearance="outline". Riproduci i clic sull’etichetta e sul contorno, quindi verifica che entrambi attivino le opzioni mantenendo il comportamento previsto dell’etichetta.

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
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.