Append to window scroll
See original GitHub issueIt is a pleasure writing an issue in such a great project!
I was wondering, if leaving the height and width properties on their own (https://codesandbox.io/s/empty-breeze-jzbry?file=/src/App.js:595-649) is the best option to make scrollable element of list snap to window scrollbar. It seems a little buggy. Do we have an option to make virtualized element snap its scrollbar to main browser scrollbar?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:14 (6 by maintainers)
Top Results From Across the Web
When window scroll, I want to append a div and hide the div ...
I want to create a function, when user scroll down to the middle, the menu will have a class 'sticky', when the div...
Read more >Window.scroll() - Web APIs - MDN Web Docs
The Window.scroll() method scrolls the window to a particular place in ... Specifies the number of pixels along the Y axis to scroll...
Read more >Append to window scroll · Issue #14 · TanStack/virtual - GitHub
My solution for true virtual concept in window scroll - sample live code. window scroll (without virtual concept). const parentRef = React.
Read more >.scroll() | jQuery API Documentation
The scroll event is sent to an element when the user scrolls to a different place in the element. It applies to window...
Read more >Window sizes and scrolling - The Modern JavaScript Tutorial
How do we get the full width and height of the document, including the scrolled out part? How do we scroll the page...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

My solution for true virtual concept in window scroll - sample live code
@tannerlinsley Thank you for such a great library
I currently use this wrapping hook, compatible with the current release (v2.2.5):
Usage is just like the regular
useVirtual()(provide the scrolled list asparentRef).As you can see it has to mock the parentRef to intercept bounds checking and the scroll event. Ideally some variation of the version provided by @petersendidit above would avoid these ugly hacks, while not messing with the API surface too much for the sake of a single use case.