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 version 5.17.8 still has the error steps to reproduce #7943

Closed
santilp95 opened this issue Feb 15, 2023 · 4 comments
Closed
Labels
component: data grid This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@santilp95
Copy link

          > > > > datagrid version 5.17.8 still has the error steps to reproduce
  1. place datagrid on a page
  2. place datagrid on the same page inside dialog
  3. open dialog and click on datagrid row

image
as a result publishClick** event fired twice for both datagrids but second event can't find column.
Any thoughts why event rowClick event fired twice for both datagrids?

This is more or less the exact setup I have too. When opening a Dialog with another DataGrid inside the column.type check fails

Make sure you don't have a cicle dependencies in your code. As this was exactly what happened to me. It clicks cicle twice instead of one time.

Can you explain a bit more? This same issue is bugging me, and I don't seem to get a solution from Google.

Adding e.stopPropagation() to the click handler fixed it for me.

Originally posted by @peter-hg in mui/material-ui#30562 (comment)

but when i put e.stopPropagation() GridActionsCellItem doesn't work

@santilp95
Copy link
Author

The solution is put e.stopPropagation()

<DataGrid
...anotherProps
onCellClick={(row, e) => e.stopPropagation()}
/>

@Luif3rch
Copy link

is the best solution for this problem thankyou you have earned a beer, my friend

@ZeeshanTamboli ZeeshanTamboli transferred this issue from mui/material-ui Feb 15, 2023
@zannager zannager added component: data grid This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 15, 2023
@m4theushw
Copy link
Member

It's the same bug from #4243

We need to add a check to ignore if the field is not in the columns prop.

@m4theushw m4theushw added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 16, 2023
@ibah111
Copy link

ibah111 commented May 29, 2023

brat, it's not the solutuion, it's just a time plug, that can make some troubles in future.

Edit: For anybody, who will use this method to solve the problem, make sure that u will not add any other functional to your data grid, cuz "stopPropagation()" prevents further propagation of the current event.

Read 'bout this on: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation

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! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants