-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
[BUG] Vertical scroll doesn't work properly if horizontal scroll is present and moved #609
Comments
What browser/OS? Can you record a video? |
react-virtuoso.mp4My OS: Chrome 99, windows 10 pro |
The issue doesn't occur in Firefox. However, I can confirm that it occurs in Chrome and Edge. |
Ran into this issue as well on Chrome. I had a look at the call stack for when the scroll event gets is triggered on the virtuoso-scroller and it traces back to the event handler in Not sure why the event is continuously fired. Happy to try to make a PR, but currently I don't understand the codebase enough to know where to proceed. |
Got this issue as well on my Chrome as well, but it works on my Safari. Screen.Recording.2022-05-06.at.11.47.00.PM.movBrowser: Chrome Version 100.0.4896.127 (Official Build) (arm64) |
I noticed this becomes an issue when the first column is not in view anymore. So with the sticky column example it only becomes a problem if you scroll horizontally that far that even if the column would not be sticky, it would be out of view. Maybe it is something that looks at the first column and because it's out of view it becomes an issue? @petyosi do you know any part of the code that looks at the first column size or something like that? I tried to look to find something myself but I have a hard time finding where I need to be. If you have some ideas where to look at then I am happy to make a PR. |
After debugging for a while I noticed that it isn't necessarily an issue with the first column being the issue but it has more to do with the fact that the height and widths of the rows/columns are changing while scrolling and the reason why we saw this issue when we scrolled that far that the first column was not visible is because of the fact that the first column in the examples had a fixed width and the others had a dynamic width. In an example where all the columns have a fixed width scrolling works normally: https://codesandbox.io/s/sandpack-project-forked-4lf9o5?file=/App.js So a workaround for now would be to set a fixed width for each column. |
The issue is still present in the example with all fixed width columns: 2022-05-17.09-11-10.mp4 |
Here's a workaround for the problem, which I am not exactly happy with. https://codesandbox.io/s/sandpack-project-forked-pg6te6?file=/App.js The problem seems to be related that the filler row To ensure that we don't conflate two separate problems: since the table is virtualized, it's highly recommended to:
Otherwise, the width of the columns will fluctuate when scrolling around, based on the content in it. There's no magic that can guess what the width of the column be since the content is not available. If anyone has a better idea on how to make a filler row - please share. |
I don't thing that this solves the problem. I'm using fixed layout and fixed width columns but i'm facing the same behavior. |
@mrfrigerio Reproduce the problem using the workaround from my previous comment in a sandbox and paste a link here. |
Sorry @petyosi , my bad. I didn't see the custom FillerRow. Implementing that way works like a charm. Thank you |
I was experiencing the same problem. Solved by this css rule
I found the solution here https://github.com/TanStack/virtual/issues/426 |
@ivanjoz Thanks for sharing that, I incorporated the fix. |
🎉 This issue has been resolved in version 4.3.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello,
In the TableVirtuoso component, vertical scroll doesn't work properly if horizontal scroll exists and is moved to the right.
The bug is present even on the demo page.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Vertical scrollbar should properly scroll according to the current mouse position.
The text was updated successfully, but these errors were encountered: