Skip to content

table组件使用colspan对固定列设置合并时单元格偏移错误 #54860

@cactuser-Lu

Description

@cactuser-Lu

Reproduction link

Edit on CodeSandbox

Steps to reproduce

对于以下代码,当0、1列为固定列,且使用 onCell 进行表格列合并时,存在一个问题:

//第0列
onCell: (_, index) => ({
 colSpan: index === 1 ?0 : 1,
}),
//第1列
onCell: (_, index) => ({
 colSpan: index === 1 ?2 : 1,
}),

偏移不正确:在计算固定列的 left 偏移时,这里的left计算为width[0] ,而实际应该为0,出现重叠或错位。

What is expected?

第一行固定列偏移为0

What is actually happening?

第一行固定列偏移为width[0]

Environment Info
antd 5.27.2
React 19.1.0
System window10专业版
Browser Chrome 139.0.7258.155

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 BugAnt Design Team had proved that this is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions