Skip to content

Commit

Permalink
fix: fix header select perf in tranpose table
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jul 12, 2023
1 parent a5db3a7 commit 9ca64d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function createComplexColumn(
for (let j = rowStart; j <= rowEnd; j++) {
const row = j;
const define = cellType !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
const mayHaveIcon = cellType !== 'body' ? true : !!define?.icon;
const mayHaveIcon = cellType !== 'body' ? true : !!define?.icon || !!define?.tree;
const headerStyle = table._getCellStyle(col, row);
const cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;
cellTheme.group.width = colWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ export class SceneProxy {
if (row < rowStart || row > rowEnd) {
return emptyGroup;
}
if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {
return emptyGroup;
}
if (this.cellCache.get(col)) {
const cacheCellGoup = this.cellCache.get(col);
if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
Expand Down
3 changes: 2 additions & 1 deletion packages/vtable/src/scenegraph/layout/compute-row-height.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ function computeTextHeight(col: number, row: number, table: BaseTableAPI): numbe
let iconInlineFrontHeight = 0;
const iconInlineEnd: ColumnIconOption[] = [];
let iconInlineEndHeight = 0;
const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!table.getBodyColumnDefine(col, row)?.icon;
const define = table.getBodyColumnDefine(col, row);
const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;
if (mayHaveIcon) {
const icons = table.getCellIcons(col, row);
icons?.forEach(icon => {
Expand Down

0 comments on commit 9ca64d4

Please sign in to comment.