angular / angular/components

Mat Stepper needs a beforeSelectionChange event

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

説明

### Feature Description

There should be an event that is triggered when you attempt to navigate to a different step via the mat stepper header.

Currently, there is only a `selectionChange` event that doesn't get triggered until _after_ the next navigation takes place.

### Use Case

In my scenario, when a user attempts to navigate to the next step, I need to first call an endpoint to validate the data they entered. Once I have validated that the data is correct, I can proceed to the next step with `stepper.next()`. This works as expected if the user clicks on my next button with a custom `(click)` event, but if they click on the header to navigate, there is no way to call the endpoint before navigation.

Using `selectionChange` does not work, because there is no way to prevent navigation after the `StepperSelectionEvent` has happened.

Alternatively, instead of a `beforeSelectionChange` event, if there were a way to prevent the next navigation when subscribing to the `selectionChange` event, that would also work. Or if there was a way to prevent navigation from the header, but still capture clicks, so that `stepper.next` could manually be called.

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

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

調査の方向性

mat stepper のヘッダーナビゲーションと既存の selectionChange イベントから始め、その後、そのフローを issue に記載された stepper.next() のエントリーポイントと比較します。変更が完了した状態とは、ヘッダーナビゲーションを選択前に検証または阻止でき、プログラムによる次のステップへのナビゲーションが引き続き機能することです。

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

評価

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

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

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