Scroll anchoring on height changes and inserts
When rows above the viewport are inserted, removed or change height, WarGrid keeps the first visible row at the same on-screen position. Native CSS scroll anchoring is disabled in favor of a deterministic grid-managed anchor. This prevents content jumping during live data feeds and auto-height correction.
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
A live feed inserting 5 rows per second at the top, with auto-height rows; the user is scrolled to the middle.
Expected behavior
With anchoring on, the viewed content stays put while the scrollbar thumb shifts. With anchoring off, content visibly drifts. The focused-row strategy keeps the focused row stable instead.
Planned API surface
scrollAnchoringanchorStrategyonAnchorAdjustAcceptance criteria
- With first-visible strategy, the anchored row's on-screen top changes by no more than 1px after inserts above it. (pending)
- When the user is at scrollTop 0, new top inserts become visible (anchoring to the top is documented as an option). (pending)
- Native overflow-anchor is set to none on the scroll container. (pending)
- onAnchorAdjust reports the delta applied. (pending)