Incorrect pagination behavior with autoResetPageIndex set to true when deleting rows
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
まず、ページネーション、削除用の表示列、および autoResetPageIndex を false に設定した、約束されていた最小限の再現可能な例を作成します。最後のページの最終行を削除したときにページネーションの状態がどのように反応するかを追跡し、その後、pageIndex が更新後のページ数の範囲内にとどまることと、関連するページネーションのテストが通ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Currently working on a table with pagination and a display column that removes the current row.
- The data for the table is stored in react state and passed into the data prop.
- The display column performs a removal by filtering the current row out of the state.
Accordingly, autoResetPageIndex needs to be set to false to prevent the pageIndex state from resetting on every row delete.
Everything works well until all of the rows are deleted on the last page.
The pageIndex state doesnt update, even though the getPageCount response does.
I would assume that even with autoResetPageIndex set to false, the pageIndex state should update when data is deleted and the page count decreases.
Your minimal, reproducible example
will provide on request
Steps to reproduce
Steps To preproduce
- Create a table that:
- uses pagination
- has a display column to remove the current row
- has autoResetPageIndex set to false
- has enough data to populate more than one page
- navigate to the last page
- remove all of the rows by clicking the delete buttons one by one
Expected behavior
Expected:
When the last row is removed the table state should decrease the pageIndex state to match the page count
Actual:
pageIndex is unchanged and there is no data shown since the pageIndex is out of range relative to the new number of pages
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
issue happens on any OS with any browser
react-table version
8.5.15
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- 主要言語
- TypeScript
- スター
- 28.5k
- フォーク
- 3.6k
- 平均マージ
- 19時間 40分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/table のほかの issue
-
Issue template renders `react-table`, not `TanStack/table`対応中かも @vishruthasgowda が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
TanStack/table#6595 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
TanStack/table#6601 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Cast required to access custom options when defining a custom plugin/feature対応中かも @sorena-paydar が 14 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`対応中かも @cpruijsen が 25 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
capricorn86/happy-dom#2474 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JSerwatka/letterboxd-tweaks#81 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
siyuan-note/siyuan#20165 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
polkadot-js/phishing#5716 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
juice-shop/juice-shop#3662 ·
メンテナーはふだん 1 日以内に返信