Reference home > @af-utils/virtual-react > mapVisibleRangeWithOffset

mapVisibleRangeWithOffset() function

Map current visible items and provide offset for each item.

Signature:

mapVisibleRangeWithOffset: <T>(model: VirtualScroller, cb: (index: number, offset: number) => T) => T[]

Parameters

Parameter

Type

Description

model

VirtualScroller

VirtualScroller instance

cb

(index: number, offset: number) => T

callback

Returns

T[]

Array of currently visible items

Remarks

Used in scenarios, when each item is absolutely positioned