Skip to content

fix(datagrid-web): virtual scroll loses scrollbar after column hide#2167

Open
rahmanunver wants to merge 2 commits intomainfrom
fix/dg2-virtual-scroll-column-hide
Open

fix(datagrid-web): virtual scroll loses scrollbar after column hide#2167
rahmanunver wants to merge 2 commits intomainfrom
fix/dg2-virtual-scroll-column-hide

Conversation

@rahmanunver
Copy link
Copy Markdown
Contributor

Pull request type

Bug fix


Description

What: lockGridBodyHeight() in GridSizeStore locked 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 locked max-height — the scrollbar disappears.

Why: The reset condition was incomplete. The existing lockedAtPageSize guard pattern was correct but not applied to column-count changes. The fix adds a parallel lockedAtColumnCount guard: 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 — added lockedAtColumnCount guard
  • src/model/containers/Datagrid.container.ts — wired visibleColumnsCountAtom into GridSizeStore via DI
  • src/components/Pagination.tsx, src/components/WidgetFooter.tsx — pre-existing TS7006 implicit-any fixes (were already failing on main)
  • e2e/DataGrid.spec.js — regression test: virtual scroll + column hide
  • AGENTS.md — architecture reference for the datagrid-web package

What should be covered while testing?

  1. Open a page with a Data Grid configured for virtual scrolling and enough rows to produce a scrollbar
  2. Confirm the scrollbar is visible in the grid body
  3. Open the column selector and hide any column
  4. Confirm the scrollbar is still visible after hiding — this was the bug
  5. Show the column again and confirm the scrollbar remains consistent

@rahmanunver rahmanunver requested a review from a team as a code owner April 8, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant