WarUI

Pagination and scroll position anchoring

GRID-A21-F07P1beyond-baselinePlanned

Persists the current page, the page size and the vertical and horizontal scroll position. Vertical scroll is stored as an anchor row id plus a pixel offset instead of a raw scrollTop, so the restored view stays correct even when row heights or data change.

Planned. This page shows the specification from issue #201. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A grid of 10,000 rows with variable row heights and a pager.

Expected behavior

With the rowId strategy, inserting rows above the current position and then restoring still shows the anchor row at the same viewport offset. With the offset strategy, the view visibly shifts. The demo makes this difference clear.

Planned API surface

getState().paginationgetState().scrollsetState({pagination, scroll})scrollAnchorStrategyonScrollStateChange

Acceptance criteria

  • Pagination is stored as pageIndex and pageSize. (pending)
  • A pageIndex beyond the last page is clamped to the last valid page. (pending)
  • The scroll state contains anchorRowId, anchorOffsetPx and scrollLeft, or a raw top value when using the offset strategy. (pending)
  • Scroll restoration is applied only after the target rows have rendered and does not cause visible jitter. (pending)
  • Horizontal scroll is restored relative to the first visible unpinned column id. (pending)