diff --git a/common/changes/@visactor/vtable/fix-custom-merge-update_2024-07-29-13-26.json b/common/changes/@visactor/vtable/fix-custom-merge-update_2024-07-29-13-26.json new file mode 100644 index 000000000..f3ae6ee33 --- /dev/null +++ b/common/changes/@visactor/vtable/fix-custom-merge-update_2024-07-29-13-26.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "fix: fix customMege cell update", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file diff --git a/packages/vtable/src/scenegraph/layout/update-height.ts b/packages/vtable/src/scenegraph/layout/update-height.ts index 1f48e6405..ef178c84a 100644 --- a/packages/vtable/src/scenegraph/layout/update-height.ts +++ b/packages/vtable/src/scenegraph/layout/update-height.ts @@ -206,8 +206,8 @@ export function updateCellHeight( } const mergedCell = scene.getCell(col, mergeRow); const customContainer = - (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) || - (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group); + (mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) || + (mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group); customContainer.removeAllChild(); mergedCell.removeChild(customContainer); getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table); diff --git a/packages/vtable/src/scenegraph/layout/update-width.ts b/packages/vtable/src/scenegraph/layout/update-width.ts index 15f4f189c..a885a6840 100644 --- a/packages/vtable/src/scenegraph/layout/update-width.ts +++ b/packages/vtable/src/scenegraph/layout/update-width.ts @@ -366,7 +366,7 @@ function updateCellWidth( const mergedCell = scene.getCell(mergeCol, row); const customContainer = (mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) || - (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group); + (mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group); customContainer.removeAllChild(); mergedCell.removeChild(customContainer); getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);