next icon indicating copy to clipboard operation
next copied to clipboard

[Table]Table useVirtual=true 时,跨页勾选多选框,回调数量对不上

Open alvarto opened this issue 2 years ago • 1 comments

Component

Table

Reproduction link

https://riddle.alibaba-inc.com/riddles/45980b7e

Steps to reproduce

  1. 勾选首屏幕的任意一项
  2. 往下滚动一屏,勾选第二项
  3. 可以看到 rowSelection.onChange 和 rowSelection.onSelect 回调里的首参数和第二参数个数不一致

image

alvarto avatar Jul 09 '21 06:07 alvarto

selectedRows是当前页选中的项,切换页码会重置,但是selectedRowsKeys会默认保存之前其他页码选中的和当前页面选中的,但回到上一个页码选中的效果也没了,但数据项依旧在里面,感觉都有自己的业务场景,要不要做个兼容

jeryqwq avatar May 17 '22 16:05 jeryqwq

需要新增一个参数如 keepBeforeSelectedRowKeys=true

  • true (默认) 则保留之前的选择,并修复 selectedRows 数量与 keys 数量不一致的问题;
  • false,则不保留之前页面的选择,仅返回当前页数据的 keys 和 rowsData

YSMJ1994 avatar Mar 04 '24 04:03 YSMJ1994