-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Row ordering fix for virtualization #6765
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zannager
added
the
component: data grid
This is the name of the generic UI component, not the React module!
label
Nov 7, 2022
These are the results for the performance tests:
|
4 tasks
I have found other ways to fix this issue without using |
@yaredtsy in order to move forward please fill in and submit the CLA form -> https://forms.gle/RTDocuuVsEuUbxJ57 |
DanailH
added
CLA: required
See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0
feature: Reordering
Related to the data grid Reordering feature
feature: Rendering layout
Related to the data grid Rendering engine
bug 🐛
Something doesn't work
and removed
on hold
There is a blocker, we need to wait
labels
Jan 6, 2023
oliviertassinari
added
CLA: signed
See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0
and removed
CLA: required
See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0
labels
Jan 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug 🐛
Something doesn't work
CLA: signed
See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0
component: data grid
This is the name of the generic UI component, not the React module!
feature: Rendering layout
Related to the data grid Rendering engine
feature: Reordering
Related to the data grid Reordering feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6165
Problem
Row ordering sometimes won't work with virtualization enabled. if the row that's being dragged unmounted
onDragEnd
event won't be triggered.uu.mov
Solution
I looked at how other people approach this problem (AG-Grid, react-beautiful-dnd). When you drag an element, you drag the element or a copy of the element, which will always be in the DOM. but in MUI-DataGrid, when you drag a
row
you are dragging the ghost of therow
so the element might get unmounted while dragging when virtualization is enabled. This causesonDragEnd
not to be triggered. This can be solved by addingdragend
listener withaddEventListener
to the row because DOM event listeners persist longer than component life cycles.