angular / angular/components

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

Ouverte
#27,682 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: material/select P2
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

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et l’interaction entre select[matNativeControl] et mat-form-field appearance="outline". Reproduisez les clics sur le libellé et le contour, puis vérifiez qu’ils déclenchent tous deux les options tout en conservant le comportement attendu du libellé.

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

Recevez les nouvelles issues par e-mail

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