-
-
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
[DataGrid] Keep focused cell in the DOM #7357
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-7357--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
renderedRows
.
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.
Thanks, Yared!
I like the idea!
Here's my initial feedback on the proposed changes
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…into focused_cell_fix
Alright, I think this behavior is acceptable. Could you address the comment I left above? Could you also add tests to cover this feature? Once that is done, this should be ready. |
@romgrk done |
You need to apply |
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.
@mui/xgrid If someone else wants to add something here please do so, afaict this is ready for merging.
renderedRows
.
@yaredtsy Thanks for working on this! 🎉 |
Co-authored-by: Andrew Cherniavskii <[email protected]> Signed-off-by: Rom Grk <[email protected]>
Signed-off-by: yared tsegaye <[email protected]> Signed-off-by: Rom Grk <[email protected]> Co-authored-by: Yared Tsegaye <[email protected]> Co-authored-by: yaredtsyg <[email protected]> Co-authored-by: Rom Grk <[email protected]> Co-authored-by: Andrew Cherniavskii <[email protected]>
Problem
When
virtualization
is enabled, the focusedcells
will be unmounted when they get out of range. This causes a problem if you arereordering
or navigating with the keyboard.inspiration
I looked at how AG-grid implemented their virtualization. and what I observed is they keep the focused
Row
always in the table.bandicam.2022-12-31.20-18-45-661.mp4
Solution
the
row
which holds the focusedcell
should always be rendered, even if it's out of range it should always be inrenderedRows
Fixes
onRowOrderChange
is not called sometimes when dragging causes scrolling in datagrid. #6165Todo