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] Following 7.19.0 release setting a column definition prop to undefined doesn't reset the prop when type is set #15317

Open
iemi111 opened this issue Nov 7, 2024 · 1 comment
Labels
component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@iemi111
Copy link

iemi111 commented Nov 7, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Set one of the column definition's render props (e.g. renderCell) to a dynamic value (based on another state)
  2. Set the type of the column definition
  3. Trigger a change to the value of the render prop in Step 1

https://stackblitz.com/edit/github-3rk5go-nd8osk?file=src%2Fdemo.tsx

Current behavior

The Grid state doesn't reset to its default when the "render" prop is set back to undefined when the "type" of the column is specified but it does when the "type" is not set.

Expected behavior

If one of the props in the column definition object is updated to undefined after previously being set, then the MUI default for that prop should be used even when the type of the column definition is set.

Context

It stopped working following the 7.19.0 release. After some investigation I found it broke after #14456 was merged.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: undefined, column definition
Order ID: 91184

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

Thanks for opening this @iemi111.
I can confirm this bug and will add it to the board.

It's a great help that you found the PR that introduced it. It will speed up the process of resolving this significantly! 👍🏼

cc @romgrk

@michelengelen michelengelen changed the title [DataGridPro] Following 7.19.0 release setting a column definition prop to undefined doesn't reset the prop when type is set [data grid] Following 7.19.0 release setting a column definition prop to undefined doesn't reset the prop when type is set Nov 7, 2024
@michelengelen michelengelen added regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer bug 🐛 Something doesn't work labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

2 participants