-
-
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] horizontal scroll behavior is different between light mode and dark mode #1613
Comments
Interesting, yeah, we knew about this when we picked the current implementation: #660 (comment) |
Thank you for your quick response. I could not find this discussion... 🙇 Then, are there any workaround?
|
I have removed the "docs" label as it's not specific to our docs (it's only one way to reproduce it). We can create the same reproduction in codesandbox simply by enabling the dark mode: https://codesandbox.io/s/material-demo-forked-pt05q?file=/demo.tsx. |
I don't see a horizontal scrollbar on this codesandbox 🤔 |
In any case, this bug is expected. We measure the scrollbar width on a hidden element, which returns 0px. Then, with CSS we force a scrollbar width on the data grid container. The horizontal scroll is of the width of the scrollbar we force. |
Are there any plans to change this behavior in the future? My customer is not pleased that a horizontal scrollbar is visible when not clearly needed. I am currently looking for a workaround. Is it maybe possible to always use the default scrollbar regardless of dark or light mode? A other solution that I am thinking of in the moment is to check programmatically if a header is overflowing and hide the scrollbar based on that. |
Also we have the issue that the scrollbars in dark mode don't automatically read the global theme colors but rather have some colors and borders hardcoded. Our normal scrollbars in dark mode on Windows vs the ones in datagrid: Relates to: mui/material-ui#25016 |
Interesting. In mui/material-ui#25016 , I was proposing to expose In your case, we might need to have a dedicated theme variable. But maybe we can be smart about it and start from the background color. |
I have opened #1805 to use the opportunity found by Matheus. |
Current Behavior 😯
DataGrid horizontal scroll behavior is different between light mode and dark mode.
datagrid_horizontal_scroll.mov
Expected Behavior 🤔
Dark mode behavior should be the same as light mode one.
Steps to Reproduce 🕹
You can try it here.
https://material-ui.com/components/data-grid/components/
Context 🔦
I tried to implement dark mode, and found this bug.
The difference may come from here.
https://github.com/mui-org/material-ui-x/blob/master/packages/grid/_modules_/grid/components/containers/GridRootStyles.ts#L331-L363
Your Environment 🌎
macOS Big Sur version 11.2.3
Google Chrome 90.0.4430.93(Official Build) (x86_64)
The text was updated successfully, but these errors were encountered: