ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

Table row-selection父子节点事件和属性优先级问题

Open hzlzsm opened this issue 1 year ago • 2 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.3

Environment

browser

Reproduction link

Edit on CodeSandbox

Steps to reproduce

当table 的row-selection中的checkStrictly属性设置为false,初始selectedRowKeys也有值,初始渲染后的选中应该是selectedRowKeys中的值,因为此时并没有触发手动选择。目前初始渲染后父节点选中了,子节点即使不在选中数组里也会被选中,这个过程中不会触发onChange事件

What is expected?

初始要么选中结果和selectedRowKeys中的一样,我手动修改选中状态的时候再父子节点关联。或者初始在onChange事件中把修改值抛出来。

What is actually happening?

当table 的row-selection中的checkStrictly属性设置为false,初始selectedRowKeys也有值,初始渲染后的选中应该是selectedRowKeys中的值,因为此时并没有触发手动选择。目前初始渲染后父节点选中了,子节点即使不在选中数组里也会被选中,这个过程中不会触发onChange事件

hzlzsm avatar Jun 14 '24 07:06 hzlzsm

企业微信截图_17183483749324

hzlzsm avatar Jun 14 '24 07:06 hzlzsm

目前解决方案是重写了row-selection里的columnTitle、renderCell里面的逻辑

hzlzsm avatar Jun 17 '24 01:06 hzlzsm

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Aug 16 '24 02:08 github-actions[bot]