Skip to content

Commit

Permalink
docs: Improves readability (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
schalkventer authored Sep 16, 2024
1 parent 9f8ac01 commit 00f66eb
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 offset to scroll to, a boolean indicating if the scrolling is allowed to be smoothed, and the virtualizer instance. 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 00f66eb

Please sign in to comment.