-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[DataGrid] Do not call preProcessEditCellProps()
if cell is not editable based on isCellEditable()
#18405
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
Conversation
Signed-off-by: Steve Xu <stevexugc@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ...
@arminmeh should we backport this to v7 as well? Seems like an easy enough cherry-pick to do that, right? |
Deploy preview: https://deploy-preview-18405--material-ui-x.netlify.app/ Bundle size reportTotal Size Change: 🔺+282B(0.00%) - Total Gzip Change: 🔺+69B(0.00%) Show details for 100 more bundles (22 more not shown)@mui/x-data-grid parsed: 🔺+47B(+0.01%) gzip: 🔺+11B(+0.01%) |
@@ -459,7 +459,12 @@ export const useGridRowEditing = ( | |||
} | |||
|
|||
columns | |||
.filter((column) => column.editable && !!column.preProcessEditCellProps && deleteValue) | |||
.filter((column) => { | |||
const isCellEditable = apiRef.current.getCellParams(id, column.field).isEditable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that above, while reducing columns to get newProps
we also have this check.
It would be good to filter out columns based on this before both and use the result, to repeat this check 2 times
agree |
@arminmeh @michelengelen when can we expect this to be merged? |
preProcessEditCellProps
if cell is not editable based on isCellEditable()
preProcessEditCellProps
if cell is not editable based on isCellEditable()
preProcessEditCellProps()
if cell is not editable based on isCellEditable()
Cherry-pick PRs will be created targeting branches: v7.x |
…table based on `isCellEditable()` (#18405) Co-authored-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com>
fix #17856