Skip to content

Conversation

@c01dwave
Copy link

@c01dwave c01dwave commented Dec 4, 2025

Description

Fix TypeScript type definition for [TableSelectionColumn] to allow rowSpan and colSpan properties.

Closes #7347

Problem

When using rowSpan or colSpan on a selection column, TypeScript reports an error:
Type '(rowData: T) => number' is not assignable to type 'undefined'.

However, the runtime behavior works correctly - selection cells can be merged as expected.

Root Cause

In commit f56d978 (2021-03-24), when rowSpan and colSpan were added to [TableBaseColumn], they were explicitly set to never on [TableSelectionColumn] This was likely an intentional design decision at the time, but it doesn't match the actual runtime behavior where these properties are supported.

Solution

Change the type definition from:

colSpan?: never
rowSpan?: never

to:

colSpan?: (rowData: T, rowIndex: number) => number
rowSpan?: (rowData: T, rowIndex: number) => number

This aligns the type definition with the actual runtime behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TableSelectionColumn的rowSpan、colSpan 类型为 never,导致赋值报错

1 participant