-
-
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] Fix scrollbar position not being updated after scrollToIndexes
#14888
Conversation
Deploy preview: https://deploy-preview-14888--material-ui-x.netlify.app/ |
cae7431
to
005e2cf
Compare
Not sure you fixed it already, but wrapping the events in
|
/** | ||
* The React ref of the grid's vertical virtual scrollbar container element. | ||
*/ | ||
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement>; | ||
/** | ||
* The React ref of the grid's horizontal virtual scrollbar container element. | ||
*/ | ||
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement>; |
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.
Do these need to be public? I'd rather avoid exposing stuff until it needs to be exposed, once it's public it can't be refactored/removed.
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.
I also wanted to refactor the names to remove the "virtual" prefix from everywhere (but I couldn't because it would be a breaking change), it would make for more readable names and shorter lines. It could be interesting to name those just scrollbarXxxxRef
.
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.
They're defined in the GridCorePrivateApi
interface, so not public 👍🏻
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.
The only public thing around this are few classes
https://mui.com/x/api/data-grid/data-grid/#data-grid-classes-MuiDataGrid-virtualScroller
we can make the change in v8 if you want to have a cleanup
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.
by the way, merging this to fix the regression for the release
renames can be handled separately
Reverts #14877, because of a regression
Fixes #14830
Instead of changing the event listeners, new approach is to directly update scroll positions of the scrollbars together with the position of the scroller via refs