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

[DataGridPro] Stop drag event propagation #2987

Merged

Conversation

chendoron
Copy link

Copied off of this PR:
#2802

Fixes #2680

The company I work for uses your paid product but we have yet to migrate to MUI v5.
This is why we're suggesting this PR also merged into V4.

@flaviendelangle flaviendelangle changed the title Stop drag event propagation [DataGridPro] Stop drag event propagation Oct 25, 2021
@m4theushw
Copy link
Member

m4theushw commented Oct 25, 2021

Since you already did the effort of cherry-picking the change, I don't see a problem in merging this one. However, I don't know when we're going to release a patch version, as the effort is now on v5. For now, you can use the "preview" generated by CodeSandbox in your project: /~https://github.com/mui-org/material-ui/blob/master/CONTRIBUTING.md#how-can-i-use-a-change-that-wasnt-released-yet. Here's an example with the fix from this PR applied: https://codesandbox.io/s/material-demo-forked-y3icv?file=/demo.js

Note that the crash I pointed in #2802 (comment) remains. The drop event is leaking to ReactDnD, so additional logic will be necessary to stop the propagation of this event.


Side note: It's not necessary to make modifications in the DataGrid to make it compatible with ReactDnD. By only using the API, it's possible to stop the propagation. The fix could be done in the user-space. Here's an example of how to make it work with v4: https://codesandbox.io/s/material-demo-forked-3s4df?file=/demo.js

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 25, 2021

The company I work for uses your paid product but we have yet to migrate to MUI v5.

@chendoron Did you try using MUI X v5 with MUI Core v4? This combination works (https://codesandbox.io/s/material-demo-forked-3s4df?file=/demo.js)

@chendoron
Copy link
Author

chendoron commented Oct 25, 2021

For now, you can use the "preview" generated by CodeSandbox in your project: /~https://github.com/mui-org/material-ui/blob/master/CONTRIBUTING.md#how-can-i-use-a-change-that-wasnt-released-yet. Here's an example with the fix from this PR applied: https://codesandbox.io/s/material-demo-forked-y3icv?file=/demo.js

I do see see the following in package.json

"@mui/x-data-grid-pro": "https://pkg.csb.dev/mui-org/material-ui-x/commit/f0cf3769/@mui/x-data-grid-pro"

Is that reliable in long term? How long would it take to get a release out for v4?

@DanailH
Copy link
Member

DanailH commented Oct 26, 2021

If this is still needed I can make the effort to ship this with the weekly release. Just be cautious about what @m4theushw said about the additional logic needed to make ReactDnD work.

@timbuckley
Copy link

timbuckley commented Oct 27, 2021

Thank you all for the quick attention to this, and for the various solutions, some of which I believe will resolve the immediate issue for us.

@DanailH Yes we would prefer this to be shipped if that works for you all.

@m4theushw We understand the bulk of new work and features should go to v5, but as a resource-constrainted startup we definitely need v4 to receive bug-fixes and patches. We can't take time to migrate v4->v5 in the near term, and deal with possible style regressions thay may cause. 5 was only just released last month afterall, so think we would still be in a reasonable support window.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 27, 2021

For context: https://mui.com/pricing/

We roll bug fixes, performance enhancements, and other improvements into new releases; we don't patch, fix, or in any way alter older versions.

So I think that if we release the changes, it should be an exception, the last one, once v5 stable is out. This is a policy that many MIT and commercial options have. It didn't seem to create issues for them to get used. So yes, it's not as great as cherry-picking, but it's a high opportunity cost for maintainers. I have always assumed that projects that do this are not long-term (2-5y) focused.

I had to push two commits to fix the CI.

@m4theushw m4theushw merged commit 925ad72 into mui:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants