-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scroller on window.onscroll #70
Comments
I don't think I understand. Even if your virtual list/table was 100% width and height of the viewport, you wouldn't be able to use window scroll because the scrollable region of items would be inside of the list/table. (That's how the virtualization is done.) Maybe you could explain in a different way? |
I want to use the entire window as a scroll container instead of just a single div. |
But what would be the difference if the div was the full width and height of the window? |
Yeah i understood that Assume that you have a pagelayout of header, footer, left sidebar and content (react-vrtualized list) is in the middle. Currenlty the scrollbar is coming only for the content wrapper div. My usecase is, i want the scrollbar to be at the window level. Meaning the content wrapper should be window instead of wrapper div. Any help appreciated 👍 |
I don't understand why you'd want that, but maybe once you have it working you can show me and I would? :) Anyway... you could accomplish that by doing the following:
I mentioned |
@bvaughn the following layout cannot currently be implemented with react-virtualized https://app.tech.eu/companies. If you see the virtual container with the list items is part of the whole page and scrolls along with the other elements. A height is set on the list container that is equivalent to the number of virtual list items but only the currently visible ones are rendered. That is the use case + performance issues that made me implement something like this my self instead of using the existing open source ones. React virtualized seems performant enough on first look. It would be nice to support this kind of functionality. |
Does the approach I described above for @harrybabu not enable this sort of layout? It seems to me like it should. Maybe I'm missing something? |
The problem is that virtual scroll creates an inner scroll container. In the page I linked above I need other elements apart from the elements in the virtual list to be scrolling on the same container. The only way I can see your approach working is if I put every element inside the virtual scroller. I would have to put also in there the filters or any other text that goes above the list. Also the approach described seems a bit hacky and convoluted to me. As a first time user to the component I would definitely stay away from this. I am not currently using react-virtualized and I am giving this feedback only to make this better and because I think you dont fully understand the issue reported. As far as fixing this maybe it does not make sense to cover all use cases anyways. Better do one thing and do it well than becoming a bloated and slow component. For the use case of scrolling inside a div the component seems to be working pretty well. |
That's why I mentioned steps 3 (disable the inner scroll) and 4 (relay window scroll info to the list/grid). I do understand the issue being reported but I appreciate your offering extra context. I'm not sure this is something I want to support within any of my virtualized components for fear of bloating them. I could potentially create a HOC that could be used to decorate a virtual list and coordinate the pattern I mentioned above. |
Currently the scroller is visible on the container div and the scrolling logc works for the particular div, is it possible to emulate the logic on window.onscroll.
The text was updated successfully, but these errors were encountered: