Skip to content

Commit

Permalink
Update virtualizer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
schalkventer authored Sep 12, 2024
1 parent 7089985 commit f5b7e87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/api/virtualizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ scrollToFn?: (
) => void
```

An optional function that (if provided) should implement the scrolling behavior for your scrollElement. It will be called with the following: An offset to scroll towards; a boolean indicating whether scrolling can be smoothed; and the virtualizer instance itself. Built-in scroll implementations are exported as `elementScroll` and `windowScroll` which are automatically configured for you by your framework adapter's exported functions like `useVirtualizer` or `useWindowVirtualizer`.
An optional function that (if provided) should implement the scrolling behavior for your scrollElement. It will be called with the following arguments:

- An `offset` (in pixels) to scroll towards.
- An object indicating whether there was a difference between the estimated size and actual size (`adjustments`) and/or whether scrolling was called with a smooth animation (`behaviour`).
- The virtualizer instance itself.

Note that built-in scroll implementations are exported as `elementScroll` and `windowScroll`, which are automatically configured by the framework adapter functions like `useVirtualizer` or `useWindowVirtualizer`.

> ⚠️ Attempting to use smoothScroll with dynamically measured elements will not work.
Expand Down

0 comments on commit f5b7e87

Please sign in to comment.