-
-
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
[DataGridPro] Fix pinned columns in RTL mode #14586
Conversation
refs.fillerLeft = findGridElement( | ||
apiRef.current, | ||
isRtl ? 'filler--pinnedRight' : 'filler--pinnedLeft', | ||
); | ||
refs.fillerRight = findGridElement( | ||
apiRef.current, | ||
isRtl ? 'filler--pinnedLeft' : 'filler--pinnedRight', | ||
); |
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.
Inverting these fixes an issue where pinned column viewport fillers were resizing the opposite sides:
Screen.Recording.2024-09-11.at.15.26.22.mov
position: isRtl ? 'right' : 'left', | ||
filterFn: (index) => (isRtl ? index < colIndex! : index > colIndex!), |
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.
Inverting the position and filter function fixes an issue where the other cells within the pinned columns were not being resized:
Screen.Recording.2024-09-11.at.16.07.32.mov
Deploy preview: https://deploy-preview-14586--material-ui-x.netlify.app/ |
pinnedLeftLength: number, | ||
) { | ||
const factor = isRtl ? -1 : 1; |
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.
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.
Nice, we clearly missed this in Argos 👍🏻
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.
LGTM 👍
The issue of pinning columns in RTL mode has still not been resolved (#14586). If you install "@mui/x-data-grid-pro": "^7.20.0" cleanly, without remnants from previous versions, the problem persists |
Fixes #14245
Before: codesandbox
After: codesandbox
Note: Resizing left pinned columns in RTL mode has the same issue that LTR see on right pinned columns (#12852). This PR does not attempt to fix that, as there is already a PR in progress for this issue (#12979).