Skip to content

Commit

Permalink
fix: seriesNumberHeader 不应该使用 custom row cell (#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjgogogo authored Dec 7, 2023
1 parent 741e27a commit fd1b883
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/s2-core/src/facet/header/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ export class RowHeader extends BaseHeader<RowHeaderConfig> {
return this;
}

protected getCustomRowCell() {
const { spreadsheet } = this.headerConfig;
return spreadsheet?.facet?.cfg?.rowCell;
}

protected layout() {
const { data, spreadsheet } = this.headerConfig;
const rowCell = spreadsheet?.facet?.cfg?.rowCell;
const rowCell = this.getCustomRowCell();
each(data, (item: Node) => {
if (this.rowCellInRect(item) && item.height !== 0) {
let cell: S2CellType;
Expand Down
5 changes: 5 additions & 0 deletions packages/s2-core/src/facet/header/series-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader {
: node.height;
sNode.width = seriesNumberWidth;
sNode.rowIndex = node.rowIndex;
sNode.spreadsheet = spreadsheet;
sNode.isLeaf = true;
seriesNodes.push(sNode);
});
Expand Down Expand Up @@ -84,4 +85,8 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader {
frozenRow,
);
}

protected override getCustomRowCell() {
return null;
}
}

1 comment on commit fd1b883

@vercel
Copy link

@vercel vercel bot commented on fd1b883 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.