angular / angular/components

bug(mat-select): on openedChange, the panel value is wrong

オープン
#31,529 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/select P3
主要言語
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

18.1.2

### Description

When triggering the event "openedChange," the panel value is defined when the panel is closed (openedChange emits `false`) and the panel value is undefined when the panel is open (openedChange emits `true`).

A current workaround is setting your logic based around the panel in a setTimeout function. My use case for this is setting an event listener on the scroll for the panel.

### Reproduction

StackBlitz link:
https://stackblitz.com/edit/brlpethk?file=src%2Fexample%2Fselect-custom-trigger-example.html
Steps to reproduce:
1. Open panel
2. See that the panel value is undefined
3. Close panel
4. See that the panel value is defined

### Expected Behavior

When the panel opens, the panel value should be defined

### Actual Behavior

The panel value is undefined

### Environment

- Angular: 19.2.14
- CDK/Material: 19.2.18
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Mac 14.7.6

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

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

調査の方向性

リンクされている StackBlitz の再現手順から始め、openedChange イベント周辺の mat-select の処理を調査します。Firefox で開く操作と閉じる操作のシーケンスを再現します。その後、開いたときにパネルの値が定義されていることを確認し、リグレッションのカバレッジを追加または更新します。

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

評価

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

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

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