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] When changing rows and columns simultaneously, new column valueGetter will be invoked on previous rows. #12190

Open
MVelez94 opened this issue Feb 23, 2024 · 3 comments · May be fixed by #12384
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!

Comments

@MVelez94
Copy link

MVelez94 commented Feb 23, 2024

Steps to reproduce

Link to live example

Steps:

  1. Run the example, and open your console.
  2. Click the button.
  3. See that, at first, the previous row is logged in the incoming valueGetter

Current behavior

Simultaneous update of rows and columns causes some columns valueGetters to operate on the previous set of rows, if said columns share the same field.

Expected behavior

I think what it should happen is that no column valueGetter should be called on previous data if it has changed. It looks like both a leak and a source of errors.

Context

I am fetching from an endpoint which provides me with the columns and the rows, so I set these upon successful fetch on a table that has preloaded data.

Your environment

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

Search keywords: data-grid x-data-grid column rows state valueGetter

@MVelez94 MVelez94 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 23, 2024
@MVelez94
Copy link
Author

I can work on this, if allowed and issue proceeds.

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Feb 23, 2024
@michelengelen
Copy link
Member

Hey @MVelez94 ... thanks for picking this up. If you need assistance please feel free to reach out!

@michelengelen michelengelen changed the title When changing rows and columns simultaneously (they were set previously), new column valueGetter will be invoked on previous rows. [data grid] When changing rows and columns simultaneously, new column valueGetter will be invoked on previous rows. Feb 26, 2024
@michelengelen michelengelen added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 26, 2024
@MVelez94
Copy link
Author

MVelez94 commented Feb 26, 2024 via email

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!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants