ant-design / ant-design/pro-components

🐛[BUG]Protable中如果第一次查询的方法current 不是1,查询结果和展示的分页不一致

Open
#8,607 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🐛 bug 描述

用户需要记录上次访问的第几页,我直接在查询时设置了current=3
传递给接口,查询的结果返回的都是第三页的数据
page呈现的选中的还是第一页

### 📷 复现步骤

![image](https://github.com/user-attachments/assets/7f80e0fe-5e22-4b00-b6ec-ac55f1809b50)

### 🏞 期望结果

查询结果返回的是第几页,分页选择应该就是第几页

### 💻 复现代码

https://codesandbox.io/s/cha-xun-biao-ge-forked-mfgf8c?file=/App.tsx

### © 版本信息

![image](https://github.com/user-attachments/assets/4a8c3276-8e67-4665-88c1-c8371bdb8fda)

### 🚑 其他信息

我尝试在外部使用了setstate更新页码信息,犹豫params 发生变化,列表又回重新渲染
我如果进行参数对比,不同在查询,actions.current.reload 就不生效了

Contributor guide

Open the contributing guide

Research direction

Start with App.tsx in the linked CodeSandbox and reproduce the case where the initial query uses current=3. Trace how the returned page and the selected pagination page are connected, then verify that the pagination selection matches the query result without breaking reload behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.