angular / angular/components

bug(tabs / mat-tab-group): Open dialog with component mat-tab-group and fast change mat-tab (click another mat-tab) and empty content

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

説明

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

If I open a dialog in which I have a mat-tab-group component and quickly click on another tab (another mat-tab), the content of the newly opened tab is not rendered - it remains empty. It looks right in DOM.

There are several ways to quickly change a tab:
1. By touch
2. Click the mouse
3. By entering the click command in the console: document.evaluate('//html[1]/body[1]/div[1]/div[2]/div[1]/mat-dialog-container[1]/dialog-data-example-dialog[1]/div[1]/mat-tab-group[1]/mat-tab-header[1]/div[1]/div[1]/div[1]/div[2]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click()

Fast click on tab after dialog open - bug
![fast-click](https://user-images.githubusercontent.com/72687375/177704151-8b1785c2-1d36-4f89-9bf4-28810c526e37.png)

Slow click on tab after dialog open - correct
![slow-click](https://user-images.githubusercontent.com/72687375/177704221-50338a57-946c-405b-807c-2f9e9ad7bd69.png)

### Reproduction

Steps to reproduce:
1. https://stackblitz.com/edit/angular-k1g4u3-pmsayf

### Expected Behavior

Correctly loaded content of the newly selected tab

### Actual Behavior

The empty content of the newly selected tab

### Environment

- Angular: 14.0.0
- CDK/Material: 14.0.4
- Browser(s): Google Chrome 103.0.5060.66
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

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

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

調査の方向性

リンクされた StackBlitz の再現手順から始め、mat-tab-group を含む mat-dialog-container を操作し、別の mat-tab への素早い切り替えも行います。ダイアログを開いている間のタブのレンダリング動作を追跡します。完了条件は、新しく選択されたタブが、タッチ、マウス、スクリプトによるクリックで一貫してコンテンツを表示することです。

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

評価

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

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

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