Measurement and anchoring
DOM-dependent sizes such as wrapped text, image ratios, and expanded content become known after rendering. Sectile's DOM and Vue connections collect those changes with ResizeObserver and apply them to layout in one batch.
Update order
- Render placements for the current viewport.
- Read the sizes of rendered elements together.
- Apply measurements from the same layout generation as one batch.
- Update coordinates from the changed range.
- Apply
scrollDeltabefore the next screen is painted.
generation identifies the layout that produced a measurement. State accepts measurements whose generation matches the current layout.
Anchor and scrollDelta
The anchor contains a stable ID and its relative viewport position. If a row before the viewport changes size or a new item is inserted, Sectile compares that ID's old and new coordinates. The difference becomes scrollDelta, which the DOM connection applies to the actual scroll position.
Vue's VirtualList, VirtualGrid, VirtualMasonry, and VirtualSpatial include this flow. With the low-level API, process measure() and the returned state and scrollDelta in the same visual update.
