diff --git a/apps/desktop/src/lib/dataGridInfiniteScroll.ts b/apps/desktop/src/lib/dataGridInfiniteScroll.ts index 608e8e1d1f..465cf9e186 100644 --- a/apps/desktop/src/lib/dataGridInfiniteScroll.ts +++ b/apps/desktop/src/lib/dataGridInfiniteScroll.ts @@ -18,6 +18,7 @@ export function dataGridScrollPosition(top: number, left: number): DataGridScrol export function shouldCheckInfiniteScrollAfterScroll(previous: DataGridScrollPosition | undefined, current: DataGridScrollPosition): boolean { if (!previous) return false; + // Shift+wheel horizontal scrolling changes scrollLeft only and must not paginate. return previous.top !== current.top; } diff --git a/packages/app-tests/dataGridInfiniteScroll.test.ts b/packages/app-tests/dataGridInfiniteScroll.test.ts index cbddca08fd..8e69d466ce 100644 --- a/packages/app-tests/dataGridInfiniteScroll.test.ts +++ b/packages/app-tests/dataGridInfiniteScroll.test.ts @@ -6,6 +6,11 @@ test("horizontal-only scroll does not check infinite scroll", () => { assert.equal(shouldCheckInfiniteScrollAfterScroll(dataGridScrollPosition(240, 0), dataGridScrollPosition(240, 180)), false); }); +test("shift-wheel horizontal scroll near the bottom does not check infinite scroll", () => { + assert.equal(isDataGridNearScrollBottom({ scrollTop: 0, scrollHeight: 80, clientHeight: 120 }), true); + assert.equal(shouldCheckInfiniteScrollAfterScroll(dataGridScrollPosition(0, 0), dataGridScrollPosition(0, 320)), false); +}); + test("vertical scroll checks infinite scroll even when horizontal offset also changes", () => { assert.equal(shouldCheckInfiniteScrollAfterScroll(dataGridScrollPosition(240, 0), dataGridScrollPosition(360, 180)), true); });