-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
dragenter event of cells do not bubble in DataGridPro #10164
Comments
Could you provide a minimal reproduction test case with the latest version? This would help identify the issue better. 👷 |
https://codesandbox.io/s/relaxed-snowflake-s98g93?file=/demo.tsx Digging a bit deeper I've learned react-dropzone was being used so the issue might actually be in that package. The live example shows the event firing as expected with DataGrid but never firing with DataGridPro |
Thanks for providing the codesandbox. I think the issue is not related to the DataGrid or DataGridPro itself, as the events are listened to by an external element and not the grid, bubbling doesn't happen in this case as the absolute element the events are binded to is above the Grid (due to a higher z-index and absolute positioning). The reason why it doesn't work for the external elements is because of the semantic positioning of the elements. Let me know if this solves your use-case? |
I still see the same behavior in the new example. I don't think it's the positioning. Dragging from system directly over a row cell in DataGridPro does not send up a dragenter the same way DataGrid does. If you drag from anywhere outside the row cell then the event triggers because entering the base of the component does trigger the event in DataGridPro. I've included a GIF demonstrating this |
@MBilalShafi Have you had a chance to look at the above video? Your example does not show the event |
I'm having exactly the same problem. I tried to add inline styles for z-index levels and made sure that the parent element is above data grid pro, and still the same problem. |
As a workaround using |
Yeah, I am facing the same problem. I tried to inspect the HTML document through Chrome dev tools and found that virtual-scroller which is handling the virtualization causes these issues. If you make the |
Sorry about the delayed response @bishopj15. It seems like it's because of the column reorder feature stopping event propagation for drag events, for example: If you could live without the column reorder feature, one fix could be to pass the prop I tried this demo and it seems to work as expected for me: https://codesandbox.io/p/sandbox/thirsty-shape-jjfdp9?file=%2FDataGridDemo.tsx, would that work for you? |
The work around in your demo does not work with the latest version, 6.19.6. I can confirm the demo using version 7 beta does work exactly how I would expect. I cannot use the beta release but using |
Hey @bishopj15, just an FYI, version 7 stable has already been released, let us know if you face any difficulties in migrating to it. Here's the migration guide to help you do it. Thank you! |
The issue has been inactive for 7 days and has been automatically closed. |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
Steps:
Current behavior 😯
dragenter event of parent never triggers
Expected behavior 🤔
dragenter event of parent triggers
Context 🔦
I have a drag and drop area over a DataGrid that has worked fine until switching to DataGridPro. The dragenter event no longer bubbles up. dragover and dragleave still bubble as expected
Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: