angular / angular/components

feat(COMPONENT): Add Possibility to stop Page Change on Paginator

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

説明

### Feature Description

Currently when you press any button on the paginator the page is changed and the PageEvent is emitted afterwards.

It would be great to be able to intercept the pageEvent before it is done and maybe call something like `event.stopPropagation()` and or `event.preventDefault()`

### Use Case

There is no way of stopping the page change for example if you would want to implement a dialog which confirms if the user wants to lose their changes made on the current page. (Especially when the paginator is not connected to the table and the pagination is used for the backend)
Here is a [stackblitz](https://stackblitz.com/edit/pbfhnu68-qn7l5mng?file=src%2Fexample%2Ftable-pagination-example.html) that shows the problem.

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

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

調査の方向性

まず、リンクされた StackBlitz で paginator の動作を再現し、ページ変更に対して PageEvent がいつ発行されるかを追跡します。早期のインターセプトでキャンセルをどのように通知すべきかを特定し、その後、確定したナビゲーションによってページが引き続き変更され、期待どおりにイベントが発行されることを検証します。

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

評価

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

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

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