Skip to content

Commit

Permalink
fix: fix customRender error in react-vtable #3142
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Dec 20, 2024
1 parent b4dc039 commit da89860
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix customRender error in react-vtable #3142",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
6 changes: 4 additions & 2 deletions packages/vtable/src/scenegraph/group-creater/cell-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import type { CreateCheckboxCellGroup } from './cell-type/checkbox-cell';
import { getHierarchyOffset } from '../utils/get-hierarchy-offset';
import { getQuadProps } from '../utils/padding';
import { updateCellContentHeight, updateCellContentWidth } from '../utils/text-icon-layout';
import { isArray, isValid } from '@visactor/vutils';
import { isArray, isNumber, isValid } from '@visactor/vutils';
import { breakString } from '../utils/break-string';
import type { CreateRadioCellGroup } from './cell-type/radio-cell';
import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight';
Expand Down Expand Up @@ -775,7 +775,9 @@ function updateCellContent(
const reactGroup = oldCellGroup.getChildByName('custom-container');
if (reactGroup) {
const { col, row } = reactGroup;
table.reactCustomLayout.removeCustomCell(col, row);
if (isNumber(col) && isNumber(row)) {
table.reactCustomLayout.removeCustomCell(col, row);
}
}
}
}
Expand Down

0 comments on commit da89860

Please sign in to comment.