-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[DataGridPro] Fix column resizing in RTL mode #4989
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
Conversation
These are the results for the performance tests:
|
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.
@@ -245,7 +259,7 @@ export const useGridColumnResize = ( | |||
const doc = ownerDocument(apiRef.current.rootElementRef!.current); | |||
doc.body.style.cursor = 'col-resize'; | |||
|
|||
separatorSide.current = getSeparatorSide(event.currentTarget); | |||
separatorSide.current = getSeparatorSide(event.currentTarget, theme.direction); |
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.
Now makes sense to rename this ref to something like expansionDirection
, since it doesn't represent the side of the separator anymore.
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.
Hmm, good point. Since it's not always an expansion, maybe resizeDirection
?
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.
resizeDirection
is good.
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.
Looks great
I like the resizeDirection
name
Wokring great! Thanks guys 👍 💯 |
* flip column resizing logic in RTL mode * rename separatorSide to resizeDirection
* flip column resizing logic in RTL mode * rename separatorSide to resizeDirection
Fixes #4954
A quick win for RTL users using DataGridPro.
Before: https://codesandbox.io/s/columnsizinggrid-material-demo-forked-vqu1sx
After: https://codesandbox.io/s/columnsizinggrid-material-demo-forked-y0we73