Tencent / Tencent/tdesign-react

[Table] onSelectChange 的参数 selectedRowData 在取消某一页的全部选择后返回[],而不是剩下页面已经选择的数据

Open
#3,228 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐞 bug
Dominant language
TypeScript
Stars
965
Forks
373
Avg merge
3d 6h
Merged PRs (30d)
17

Description

tdesign-react 版本

1.10.0

重现链接

https://tdesign.tencent.com/react/components/table?tab=demo#%E5%8F%AF%E5%88%86%E9%A1%B5%E7%9A%84%E8%A1%A8%E6%A0%BC

重现步骤

Table 组件设置了 {
colKey: 'row-select',
type: 'multiple'
}
有两页,第一页、第二页都选择了全部,回到第一页取消选择全部(通过表头的checkbox取消选择全部),剩下第2页的选项,onSelectChange 的参数 value 是第二页数据的 id,而selectedRowData是[],而不是第二页的数据

期望结果

期望selectedRowData返回的是第2页的数据

实际结果

实际selectedRowData返回的是[]

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

18.16.1

补充说明

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the Table component using the paginated-table demo linked in the issue. Trace the onSelectChange callback when all rows on page one are deselected after both pages were selected. Done means value still contains page two's selected IDs and selectedRowData contains the corresponding page-two data instead of [].

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.