-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Row auto height scroll glitch #14726
Comments
Just fyi changed version to ^6.x.x in the codesandbox example and seems this doesn't happen. |
Thank you @boldurean for reporting, I can reproduce the bug, it seems that the virtual scroller is miscomputing the render zone through the end when a cell is focused. And yes it isn't there in v6 which makes it a regression. |
@MBilalShafi thanks for response. |
We're seeing this same issue in our project (with Data Grid Pro). Scrolling a selected row (or the last selected row if multiple rows are selected) out of view causes a scrolling "jump." You can also repro this in the Row Selection docs: https://mui.com/x/react-data-grid/row-selection/#multiple-row-selection Make a couple changes to the demo code (see comments): import * as React from 'react';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';
export default function MultipleRowSelectionGrid() {
const { data, loading } = useDemoData({
dataSet: 'Commodity',
rowLength: 100,
maxColumns: 6,
});
return (
<div style={{ height: 400, width: '100%' }}>
<DataGridPro
{...data}
getRowHeight={() => 'auto'} // ADD THIS PROP
loading={loading}
pagination
initialState={{
...data.initialState,
pagination: {
paginationModel: {
pageSize: 20, // INCREASE PAGE SIZE TO ALLOW ROOM FOR SCROLLING OUT OF VIEW
},
},
}}
/>
</div>
);
} Then select one or more rows and scroll till the bottom-most selected row is out of view. You should see the jump. |
The problem in depth
Hi. We've noticed a problem with DataGrid scroll when using dynamic row height.
We thought it's our grid setup but we noticed same behaviour on the docs page as well as in your sandbox example
please see the videos below:
Screen.Recording.2024-09-25.at.09.52.37.mp4
Screen.Recording.2024-09-25.at.10.07.56.mov
It looks like it's happening not only when cell is selected, it happens in the sandbox when scrolling until end of the grid.
We have a dynamic row height with specific actions in each grid. It looks like this bugs affecting the users and they're unable to complete their actions as grid scroll randomly changes position. This happens in all browsers provided in the envinfo.
Your environment
`npx @mui/envinfo`
Search keywords: rowAutoHeight, rowHeight, getRowHeight, row height scroll glitch
Order ID: 85137
The text was updated successfully, but these errors were encountered: