Reference home > @af-utils/virtual-core > VirtualScroller > scrollToIndex

VirtualScroller.scrollToIndex() method

Scroll to item index

Signature:

scrollToIndex(index: VirtualScrollerExactPosition, smooth?: boolean, attempts?: number): void;

Parameters

Parameter

Type

Description

index

VirtualScrollerExactPosition

item index to scroll to

smooth

boolean

(Optional) should smooth scroll be used

attempts

number

(Optional) quantity of scroll attempts to be done to ensure scroll offset is correct. Defaults to 5

Returns

void

Remarks

Calls scrollToOffset with calcuated offset until desired scroll position is reached.