-
-
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
[DataGridPro] Make Row reordering work with pagination #15355
Conversation
Deploy preview: https://deploy-preview-15355--material-ui-x.netlify.app/ |
packages/x-data-grid-pro/src/hooks/features/rowReorder/useGridRowReorder.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @k-rajat19 for your contribution.
I added a few comments.
Also, Is it possible to add some test coverage for the bugfix?
packages/x-data-grid-pro/src/hooks/features/rowReorder/useGridRowReorder.tsx
Show resolved
Hide resolved
packages/x-data-grid-pro/src/hooks/features/rowReorder/useGridRowReorder.tsx
Outdated
Show resolved
Hide resolved
packages/x-data-grid-pro/src/hooks/features/rowReorder/useGridRowReorder.tsx
Outdated
Show resolved
Hide resolved
9025208
to
4626fd6
Compare
9dd1a85
to
27e3595
Compare
27e3595
to
5e80c6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing the case with the filtered data, is it possible to add some test coverage to avoid it being introduced again?
Or would it make sense to extract this specific fix in another PR and add the test along with that?
packages/x-data-grid-pro/src/hooks/features/rowReorder/useGridRowReorder.tsx
Show resolved
Hide resolved
A PR has already opened #15455 for that , if you want I can add those changes here otherwise we can do this in that PR after this one lands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM. 🎉
packages/x-data-grid/src/hooks/features/sorting/gridSortingSelector.ts
Outdated
Show resolved
Hide resolved
…ector.ts Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com> Signed-off-by: Rajat <rd.rajat23@gmail.com>
Cherry-pick PRs will be created targeting branches: v7.x |
Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com>
Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com>
Fixes #15351
getRowIndexRelativeToVisibleRows
method gives index relative to the current page causing the row-reordering to not work with pages > first page. This PR adds a new lookup to fix it.Before: https://codesandbox.io/p/sandbox/row-reorder-v5r5q9
After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-4m7hkp