Skip to content
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

[data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used #14802

Closed
annawatson-wk opened this issue Oct 2, 2024 · 4 comments · Fixed by #14929
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Rendering layout Related to the data grid Rendering engine support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@annawatson-wk
Copy link

annawatson-wk commented Oct 2, 2024

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-sux3md?file=Demo.tsx

Steps:

  1. Scroll down on the Data Grid using the scrollbar
  2. Make note of which row id you're looking at when you're about to stop scrolling
  3. Note that the row id after you've stopped scrolling, they are different

Current behavior

The row you're viewing when you release the scrollbar aren't the rows you see when you release the scrollbar. We don't see this behavior for a smaller number of rows where virtualization of rows doesn't come into play.

Expected behavior

The row you're viewing when you release the scrollbar are the rows you see when you release the scrollbar.

Context

We had a customer report this jumping behavior when they scroll using the scrollbar. The seems like this might be related to virtualization on the grid rows then those rows adjusting their size due to rowHeight auto. This was seen in version 6 and version 7 of mui-x. We're really looking for a way that we can make this virtualization/rowHeight behavior seem less clunky.

Your environment

npx @mui/envinfo
System:
    OS: macOS 13.6.2
  Binaries:
    Node: 20.8.1 - ~/.asdf/installs/nodejs/20.8.1/bin/node
    npm: 10.1.0 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 129.0.6668.71

Search keywords: scrollbar data grid jumping pro premium rowHeight
Order ID: 82849

@annawatson-wk annawatson-wk added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 2, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ labels Oct 2, 2024
@michelengelen
Copy link
Member

Hey @annawatson-wk ... I can confirm this bug and it indeed seems like the virtualization is at fault here. The scrolling position is correct, however the scrollbar will jump back to a previous position once you stop scrolling. This can be easily reproduced by quickly scrolling and keeping the scrollbar clicked when stopping the scroll movement.

Screen.Recording.2024-10-02.at.16.35.33.mov

cc @romgrk

@michelengelen michelengelen changed the title [data grid] Scrolling with scrollbar jumps between rows when autoHeight is used [data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used Oct 2, 2024
@michelengelen michelengelen added feature: Rendering layout Related to the data grid Rendering engine and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 2, 2024
@annawatson-wk annawatson-wk changed the title [data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used [data grid] Scrolling with scrollbar jumps between rows when rowHeight auto is used Oct 2, 2024
@annawatson-wk annawatson-wk changed the title [data grid] Scrolling with scrollbar jumps between rows when rowHeight auto is used [data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used Oct 2, 2024
@annawatson-wk
Copy link
Author

I just went back to change autoHeight to getRowHeight and didn't catch that you already did that. Thank you!

@michelengelen michelengelen changed the title [data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used [data grid] Scrolling with scrollbar jumps back to a previous position when getRowHeight={() => 'auto'} is used Oct 2, 2024
@romgrk
Copy link
Contributor

romgrk commented Oct 7, 2024

Investigate #14808 at the same time.

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@annawatson-wk How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Rendering layout Related to the data grid Rendering engine support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

3 participants