WarUI

scrollToRow API with alignment

GRID-A06-F13P0baselinePlanned

scrollToRow brings a row index or row id into view with a chosen alignment: auto, start, center or end. It works with variable heights, auto heights and pinned rows, and returns a promise that resolves after the target is rendered. This is the basis for search results and deep links.

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

Live example

300,000 rows with variable heights and a pinned top row; an input field for the target row.

Expected behavior

The target row appears at the requested alignment, below the pinned rows and the header. 'auto' does not scroll if the row is already fully visible. The promise resolves and the row flashes when highlight is on.

Planned API surface

scrollToRow(indexOrId, {align, behavior})onScrollToComplete

Acceptance criteria

  • With align=start, the row's top edge equals the body viewport top (excluding pinned rows), within 1px. (pending)
  • With align=auto, there is no scroll if the row is fully visible; otherwise the grid scrolls the minimal distance. (pending)
  • If the target has an unmeasured auto height, the grid corrects its position after measurement and resolves only then. (pending)
  • An invalid index or unknown id rejects with a typed error and does not scroll. (pending)