angular / angular/components

MatTab: selectedTabChange should not fire when the tab is changed programmatically

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

説明

There should be a way to differentiate **between a UI and a programmaticcally induced tab change**. As of now, both cause the selectedTabChange: EventEmitter to emit.

My case is pretty simple: I want to display the currently opened Tab in the URL:

somePage?openedTab=1
somePage?openedTab=2

But I also want the corresponding tab to open when a URL pointing to a specific tab is navigated to. **Ideally, the [selectedIndex] input should not cause (selectedTabChange) to fire**.

Does this make sense?

Material 8.2.3, Angular 8.2.11

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

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

調査の方向性

issue に記載されている MatTab の selectedIndex input と selectedTabChange EventEmitter の動作から始めます。UI による変更とプログラムによる変更をどのように区別できるかを確認し、その後、URL による変更では UI 変更の通知が発生せず、ユーザーによるタブ変更では引き続き発生することを検証します。

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

評価

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

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

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