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

[DataGrid] Fix rowModesModel controlled prop #13056

Merged
merged 1 commit into from
May 14, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented May 8, 2024

Closes #11423

I need this to work for Toolpad. Instead of creating workarounds, might as well just fix it at the root.

The problem seems to be that updateStateToStopRowEditMode in the loop doesn't run. rowModesModel is an empty object and thus the .forEach doesn't run. This PR adjusts the logic and runs the loop for each property of both previous and current rowModesModel. If the current one doesn't contain a model for a row, it assumes it's in view mode.

@Janpot Janpot added component: data grid This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels May 8, 2024
@mui-bot
Copy link

mui-bot commented May 8, 2024

Deploy preview: https://deploy-preview-13056--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against a26069a

@Janpot Janpot marked this pull request as ready for review May 8, 2024 15:23
@Janpot Janpot changed the title Fix rowModesModel controlled prop [DataGrid] Fix rowModesModel controlled prop May 8, 2024
@MBilalShafi MBilalShafi changed the title [DataGrid] Fix rowModesModel controlled prop [DataGrid] Fix rowModesModel controlled prop May 9, 2024
Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Jan!

@cherniavskii cherniavskii added the feature: Editing Related to the data grid Editing feature label May 14, 2024
@cherniavskii cherniavskii merged commit 469afc0 into mui:master May 14, 2024
19 of 20 checks passed
@Janpot Janpot deleted the rowmodesmodel-controlled branch May 21, 2024 14:25
arthurbalduini pushed a commit to arthurbalduini/mui-x that referenced this pull request May 23, 2024
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
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: Editing Related to the data grid Editing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] rowModesModel is not really usable as controlled property
3 participants