Skip to content

Commit

Permalink
fix(table): 固定列不指定colKey header错位
Browse files Browse the repository at this point in the history
  • Loading branch information
yunfeic committed Jan 27, 2022
1 parent 08ce2b5 commit 03d3936
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/table/base/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const TableCell = <D extends DataType>(props: PropsWithChildren<CellProps<D>>) =
const fixedColumns = flattenColumns.filter((column) => column.fixed === fixed);
const indexInFixedColumns = fixedColumns.findIndex(({ colKey: key }) => key === colKey);

if (indexInFixedColumns === -1) return;

fixedColumns.forEach((_, cur) => {
if ((fixed === 'right' && cur > indexInFixedColumns) || (fixed === 'left' && cur < indexInFixedColumns)) {
offset += clientWidth;
Expand Down

0 comments on commit 03d3936

Please sign in to comment.