Skip to content

Conversation

@petersendidit
Copy link
Contributor

This adds two new options which make it easier to customize the scroll
behavior.

onScrollElement which makes it possible to use a different
element to bind the onScroll event too.

scrollOffsetFn allows a custom function to calculate the offset rather
than using the parentRef's width or height.

This adds two new options which make it easier to customize the scroll
behavior.

`onScrollElement` which makes it possible to use a different
element to bind the `onScroll` event too.

`scrollOffsetFn` allows a custom function to calculate the offset rather
than using the `parentRef`'s width or height.
@tannerlinsley tannerlinsley merged commit 7ad4628 into TanStack:master Jan 29, 2021
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@hamzamihaidanielx
Copy link

Sorry but i've tried it and does not work at all...

const rowVirtualizer = useVirtual({
size: hasNextPage ? flatPosts.length + 1 : flatPosts.length,
parentRef,
overscan: 0,
estimateSize: React.useCallback(() => 48, []),
onScrollElement: React.useRef(document.documentElement)
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants