From 3a2f0eea69a1de7f66596caeba0ee7e83a73160a Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Mon, 13 Jul 2026 10:09:34 -0400 Subject: [PATCH] fix(core): compute scrollTo page before deriving the paging offset --- packages/common/src/core/slickGrid.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/common/src/core/slickGrid.ts b/packages/common/src/core/slickGrid.ts index cc786240a..26a563b4a 100755 --- a/packages/common/src/core/slickGrid.ts +++ b/packages/common/src/core/slickGrid.ts @@ -4008,8 +4008,10 @@ export class SlickGrid = Column, O e ); const oldOffset = this.offset; + // determine the page for the target position first, then derive the offset from that page + // (computing the offset from the previous page would lag one scroll event behind on jumps) + this.page = this.ph ? Math.min((this.n || 0) - 1, Math.floor(y / this.ph)) : 0; this.offset = Math.round(this.page * (this.cj || 0)); - this.page = Math.min((this.n || 0) - 1, Math.floor(y / (this.ph || 0))); const newScrollTop = (y - this.offset) as number; if (this.offset !== oldOffset) {