Skip to content

Commit b58ca96

Browse files
committed
chore: update changelog
1 parent c818d24 commit b58ca96

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

packages/pluggableWidgets/datagrid-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue where virtual scrolling prevented data loading when the grid had many columns, showing only the initial page of rows until the user performed a horizontal scroll or zoom.
12+
913
## [3.9.0] - 2026-03-23
1014

1115
### Changed

packages/pluggableWidgets/datagrid-web/src/model/hooks/useInfiniteControl.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ export function useInfiniteControl(): [trackBodyScrolling: ((e: any) => void) |
4242
);
4343

4444
useEffect(() => {
45-
const timer = setTimeout(() => isVisible && gridSizeStore.lockGridBodyHeight(), 100);
45+
const timer = setTimeout(() => {
46+
if (!isVisible) {
47+
return;
48+
}
49+
gridSizeStore.lockGridBodyHeight();
50+
51+
const gridBody = gridSizeStore.gridBodyRef.current;
52+
if (gridBody && gridSizeStore.hasMoreItems && gridBody.scrollHeight <= gridBody.clientHeight) {
53+
gridSizeStore.bumpPage();
54+
}
55+
}, 100);
4656
return () => clearTimeout(timer);
4757
});
4858

packages/pluggableWidgets/datagrid-web/src/model/stores/GridSize.store.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ export class GridSizeStore {
122122
const viewportHeight = this.computeBodyViewport();
123123

124124
// Don't lock height before the grid body has rendered content.
125-
// clientHeight is 0 when the element has no layout yet, which would
125+
// viewportHeight is 0 when cells have no layout yet, which would
126126
// produce a negative height and break scrolling.
127127
if (viewportHeight <= 0) {
128128
return;
129129
}
130130

131-
// If content already overflows the container (fixed-height grid), do not subtract the
132-
// pre-fetch offset — that would hide the last rows and trigger the next page too early.
133-
// Only subtract the offset when the grid does not yet overflow (auto-height grid) so
134-
// that we create a small synthetic overflow that makes the body scrollable.
135-
const overflows = gridBody.scrollHeight > viewportHeight;
131+
// Compare scrollHeight and clientHeight from the same element to correctly
132+
// detect whether content already overflows a fixed-height container.
133+
// If it does, do not subtract the pre-fetch offset — that would hide the
134+
// last rows and trigger the next page too early. Only subtract when the
135+
// grid does not yet overflow (auto-height grid) to create a small synthetic
136+
// overflow that makes the body scrollable.
137+
const overflows = gridBody.scrollHeight > gridBody.clientHeight;
136138
this.gridBodyHeight = viewportHeight - (overflows ? 0 : VIRTUAL_SCROLLING_OFFSET);
137139
this.lockedAtPageSize = currentPageSize;
138140
}

0 commit comments

Comments
 (0)