[WC-3333]- DG2 virtual scroll loses scrollbar after column hide#2167
[WC-3333]- DG2 virtual scroll loses scrollbar after column hide#2167rahmanunver wants to merge 4 commits into
Conversation
ccd6354 to
24be49b
Compare
24be49b to
2a93e16
Compare
AI Code Review
What was reviewed
Skipped (out of scope): Findings🔶 Medium —
|
AI Code Review
What was reviewed
Skipped (out of scope): CI checks status: unknown — Findings🔶 Medium — E2E regression test claimed in PR body but absent from diffFile: test("scrollbar remains visible after hiding a column in virtual scrolling mode", async ({ page }) => {
await page.goto("/p/virtual-scrolling");
await page.waitForLoadState("networkidle");
const grid = page.locator(".mx-name-dataGrid1");
const gridBody = grid.locator(".widget-datagrid-scroll-body");
// Confirm scrollbar is present before hiding a column
await expect(gridBody).toBeVisible();
// Hide a column via the column selector
await page.locator(".mx-name-dataGrid1 .widget-datagrid-column-selector-btn").click();
await page.locator(".widget-datagrid-column-selector-item").first().click();
// Scrollbar must still be visible
await expect(gridBody).toBeVisible();
});🔶 Medium — No unit tests for
|
Pull request type
Bug fix
Description
What:
lockGridBodyHeight()inGridSizeStorelocked the virtual scroll body height once and only reset it when the page size changed. When a column is hidden, row heights can decrease (text no longer wraps), so the content height drops below the lockedmax-height— the scrollbar disappears.Why: The reset condition was incomplete. The existing
lockedAtPageSizeguard pattern was correct but not applied to column-count changes. The fix adds a parallellockedAtColumnCountguard: the locked height is now invalidated whenever the visible column count changes, mirroring the existing page-size reset exactly.Files changed:
src/model/stores/GridSize.store.ts— addedlockedAtColumnCountguardsrc/model/containers/Datagrid.container.ts— wiredvisibleColumnsCountAtomintoGridSizeStorevia DIsrc/components/Pagination.tsx,src/components/WidgetFooter.tsx— pre-existing TS7006 implicit-any fixes (were already failing onmain)e2e/DataGrid.spec.js— regression test: virtual scroll + column hideAGENTS.md— architecture reference for the datagrid-web packageWhat should be covered while testing?