[DataGrid] All cells are all rerendered on every keystroke when row is in edit mode
Steps to reproduce
Link to live example: https://codesandbox.io/s/456w8t?file=/Demo.js
Steps:
- Set up a DataGrid with multiple rows and editable columns
- Open the React DevTools and enable the Highlight updates when components render option (or use the Profiler).
- Double click on a cell to enter edit mode
- Type some text
Current behavior
On every keystroke, all cells are shown as re-rendered.
Expected behavior
Expected result: only the edited cell should be re-rendered.
Context
A datagrid with a large number of rows and columns can become very sluggish to edit for the enduser.
Your environment
npx @mui/envinfo
Tested on latest versions of Chrome and Firefox.
System:
OS: macOS 13.5.2
Binaries:
Node: 18.17.1 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.6.7 - /usr/local/bin/npm
Browsers:
Chrome: 117.0.5938.149
Edge: Not Found
Safari: 16.6
npmPackages:
@emotion/react: latest => 11.11.1
@emotion/styled: latest => 11.11.0
@mui/base: 5.0.0-beta.19
@mui/core-downloads-tracker: 5.14.13
@mui/material: latest => 5.14.13
@mui/private-theming: 5.14.13
@mui/styled-engine: 5.14.13
@mui/system: 5.14.13
@mui/types: 7.2.6
@mui/utils: 5.14.13
@mui/x-data-grid: latest => 6.16.1
@types/react: 18.2.28
react: latest => 18.2.0
react-dom: latest => 18.2.0
typescript: 5.2.2
Search keywords: datagrid cell rerendered Order ID: 63752
No feedback or progress so far?
I'm facing the same Issue. No oficial response of MUI about this???
Hi, Sorry for the late reply, we have missed this issue somehow.
A datagrid with a large number of rows and columns can become very sluggish to edit for the enduser.
Note that both rows and columns are virtualized, so only the visible cells (+ some buffer cells) are rendered. Can you provide an example where we can reproduce the slugginess?
Expected result: only the edited cell should be re-rendered.
I'm not sure it is the expected result. In the "row" edit mode, you might have linked fields.
I feel like this is a real issue and we can improve the performance, but it would help us prioritize it if we can have an example use-case where we can see it being slow.
The issue has been inactive for 7 days and has been automatically closed.
Just for information, I will try to see if I can reproduce again the issue next week. If I find a use-case, I will re-open this issue or create a new one.