Skip to content

computeScrollMapping

Since v2.13.0

Compute a mapping between the spacer’s native scrollTop and the virtual row-content scroll offset.

For datasets within maxSpacerHeight, mapping is identity (no transform). Above the cap, the spacer is clamped and scrollTop units no longer equal row-content units — call toVirtualScrollTop / fromVirtualScrollTop to translate between the two coordinate spaces.

function computeScrollMapping(rawContentHeight: number, viewportHeight: number, maxSpacerHeight: number): ScrollMapping
NameTypeDescription
rawContentHeightnumber
viewportHeightnumber
maxSpacerHeightnumber
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt