From 494f4f39f3b6c5740e6ee7403114d33f2d078385 Mon Sep 17 00:00:00 2001 From: biubiukam Date: Tue, 16 Jun 2026 15:05:08 +0800 Subject: [PATCH 1/2] fix: handle right frozen column count update --- .../options/listTable-api-with-frozen.test.ts | 24 +++++++++++++++++++ .../vtable/src/scenegraph/layout/frozen.ts | 18 ++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/packages/vtable/__tests__/options/listTable-api-with-frozen.test.ts b/packages/vtable/__tests__/options/listTable-api-with-frozen.test.ts index eb9077cf56..14a5b62fc8 100644 --- a/packages/vtable/__tests__/options/listTable-api-with-frozen.test.ts +++ b/packages/vtable/__tests__/options/listTable-api-with-frozen.test.ts @@ -142,4 +142,28 @@ describe('listTable init test', () => { rowEnd: 29 }); }); + + test('listTable should support decreasing rightFrozenColCount by setter with row series number', () => { + const optionWithRightFrozen = { + ...option, + bottomFrozenRowCount: 0, + rowSeriesNumber: { + title: 'index', + dragOrder: true, + width: 'auto' + }, + container: createDiv(), + records + }; + optionWithRightFrozen.container.style.position = 'relative'; + optionWithRightFrozen.container.style.width = '1000px'; + optionWithRightFrozen.container.style.height = '800px'; + + const rightFrozenTable = new ListTable(optionWithRightFrozen); + + expect(() => { + rightFrozenTable.rightFrozenColCount = 1; + }).not.toThrow(); + expect(rightFrozenTable.rightFrozenColCount).toBe(1); + }); }); diff --git a/packages/vtable/src/scenegraph/layout/frozen.ts b/packages/vtable/src/scenegraph/layout/frozen.ts index e506c06b8d..5d0aadfd96 100644 --- a/packages/vtable/src/scenegraph/layout/frozen.ts +++ b/packages/vtable/src/scenegraph/layout/frozen.ts @@ -235,7 +235,9 @@ export function dealRightFrozen(distRightFrozenCol: number, scene: Scenegraph) { const headerColGroup = scene.getColGroup(col, true); insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild as Group); const bottomColGroup = scene.getColGroupInBottom(col); - insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild as Group); + if (bottomColGroup) { + insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild as Group); + } } // reset cell y let x = 0; @@ -268,12 +270,14 @@ export function dealRightFrozen(distRightFrozenCol: number, scene: Scenegraph) { ); colHeaderGroup.appendChild(headerColGroup); const bottomColGroup = scene.getColGroupInRightBottomCorner(col); - bottomColGroup.setAttribute( - 'x', - (bottomFrozenGroup.lastChild as Group).attribute.x + - table.getColWidth((bottomFrozenGroup.lastChild as Group).col) - ); - bottomFrozenGroup.appendChild(bottomColGroup); + if (bottomColGroup) { + const lastBottomColGroup = bottomFrozenGroup.lastChild as Group | undefined; + bottomColGroup.setAttribute( + 'x', + lastBottomColGroup ? lastBottomColGroup.attribute.x + table.getColWidth(lastBottomColGroup.col) : 0 + ); + bottomFrozenGroup.appendChild(bottomColGroup); + } } // reset cell y let x = 0; From c2ee2a30f1f9ba884c5aaa300143fcdbecfed033 Mon Sep 17 00:00:00 2001 From: biubiukam Date: Tue, 16 Jun 2026 15:08:28 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...ssue-3672-right-frozen-count_2026-06-16-07-08.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json diff --git a/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json b/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json new file mode 100644 index 0000000000..b0f18b824a --- /dev/null +++ b/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: handle right frozen column count update", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "biukam.w@gmail.com" +} \ No newline at end of file