angular / angular/components

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

オープン
#27,682 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: material/select P2
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた StackBlitz の再現例と、select[matNativeControl] と mat-form-field appearance="outline" の相互作用から始めます。ラベルとアウトラインのクリックを再現し、その両方でオプションがトリガーされ、期待されるラベルの動作が維持されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。