From 20585a9322c97cebd62cf6895c88a0b3460d9ba2 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Tue, 4 Aug 2026 14:38:19 +0200 Subject: [PATCH 1/2] fix(AnalyticalTable): account for horizontal scrollbar height in Auto row count --- .../AnalyticalTable/AnalyticalTable.cy.tsx | 50 +++++++++++++++++++ .../src/components/AnalyticalTable/index.tsx | 15 +++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx index f67e27bcea6..a09ffc0ea5e 100644 --- a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx +++ b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx @@ -403,6 +403,56 @@ describe('AnalyticalTable', () => { cy.findByText('Name-3').should('not.be.visible'); }); + it('Auto row count: no double vertical scrollbar when horizontally scrollable', () => { + const wideColumns = [ + { Header: 'Name', accessor: 'name', minWidth: 280 }, + { Header: 'Type', accessor: 'type', minWidth: 180 }, + { Header: 'Description', accessor: 'description', minWidth: 220 }, + { Header: 'Location', accessor: 'location', minWidth: 180 }, + { Header: 'Published', accessor: 'published', minWidth: 220 }, + ]; + const wideData = Array.from({ length: 50 }, (_, index) => ({ + name: `Item ${index}`, + type: 'Type', + description: 'Long description', + location: 'Folder', + published: 'Jun 5, 2026', + })); + + [AnalyticalTableVisibleRowCountMode.Auto, AnalyticalTableVisibleRowCountMode.AutoWithEmptyRows].forEach( + (visibleRowCountMode) => { + cy.mount( +
+ +
, + ); + + // the container must be horizontally scrollable for the scenario to apply + cy.get('[data-component-name="AnalyticalTableContainer"]').then(($container) => { + const container = $container[0]; + expect(container.scrollWidth, 'container is horizontally scrollable').to.be.greaterThan( + container.clientWidth, + ); + }); + + // the outer table root must NOT gain an additional vertical scroll range + cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"]') + .parent() + .then(($root) => { + const root = $root[0]; + expect(root.scrollHeight, 'table root is not vertically scrollable').to.be.at.most(root.clientHeight + 1); + }); + }, + ); + }); + it('autoResize', () => { function doubleClickResizer(selector: string, columnName: string, outerWidth: number) { cy.get(selector) diff --git a/packages/main/src/components/AnalyticalTable/index.tsx b/packages/main/src/components/AnalyticalTable/index.tsx index fb0fd8a9e86..7bdca79ab1e 100644 --- a/packages/main/src/components/AnalyticalTable/index.tsx +++ b/packages/main/src/components/AnalyticalTable/index.tsx @@ -483,7 +483,11 @@ const AnalyticalTable = forwardRef tableContainer.clientWidth ? scrollbarWidth : 0; + const bodyHeight = tableHeight - extensionsHeight - horizontalScrollbarHeight; let subCompsRowCount = 0; if (includeSubCompRowHeight) { let localBodyHeight = 0; @@ -514,7 +518,14 @@ const AnalyticalTable = forwardRef { setGlobalFilter(globalFilterValue); From 5e6a2828d097a2b8fedf507664877a8a6549c027 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Tue, 4 Aug 2026 17:26:23 +0200 Subject: [PATCH 2/2] Update AnalyticalTable.cy.tsx --- .../AnalyticalTable/AnalyticalTable.cy.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx index a09ffc0ea5e..e127e1bbe8a 100644 --- a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx +++ b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx @@ -434,19 +434,15 @@ describe('AnalyticalTable', () => { , ); - // the container must be horizontally scrollable for the scenario to apply - cy.get('[data-component-name="AnalyticalTableContainer"]').then(($container) => { - const container = $container[0]; - expect(container.scrollWidth, 'container is horizontally scrollable').to.be.greaterThan( - container.clientWidth, - ); - }); - - // the outer table root must NOT gain an additional vertical scroll range + // `should` retries until the auto row count settles (React 18 commits the corrected render later) cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"]') .parent() - .then(($root) => { + .should(($root) => { const root = $root[0]; + const container = root.querySelector('[data-component-name="AnalyticalTableContainer"]'); + expect(container!.scrollWidth, 'container is horizontally scrollable').to.be.greaterThan( + container!.clientWidth, + ); expect(root.scrollHeight, 'table root is not vertically scrollable').to.be.at.most(root.clientHeight + 1); }); },