angular / angular/components

bug(mat-tab): tab group dynamic does not allow to select first tab if newly created

オープン
#24,445 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/tabs 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

When i add a new tab dynamically from a button, if i choose to set the new tab as first item in the tab list and want it to select this tab, it does nothing.
I have to first select a new tab and then repeat it to make it works.

### Reproduction

https://stackblitz.com/edit/angular-qhbfy8?file=app/tab-group-dynamic-example.ts
Steps to reproduce:
1. Select checkbox : "Select tab after adding"
2. Click btn "Add new tab"

### Expected Behavior

It should select first tab

### Actual Behavior

it does not change the current tab

### Environment

- Angular: 13
- CDK/Material: 13
- Browser(s): Chrome

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

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

調査の方向性

リンクされた StackBlitz を使用して問題を再現し、app/tab-group-dynamic-example.ts と、先頭にタブを挿入する手順から始めます。動的な mat-tab group が新しく挿入された先頭のタブの選択をどのように処理するかを追跡します。チェックボックスを選択して「Add new tab」をクリックすると、直ちに先頭のタブが選択されれば完了です。

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

評価

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

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

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