Skip to content
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

[data grid] Extraneous scrollbar in footer pagination area when using CssBaseline #14814

Closed
filipneculciu opened this issue Oct 3, 2024 · 13 comments · Fixed by #14911
Closed
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@filipneculciu
Copy link

filipneculciu commented Oct 3, 2024

Steps to reproduce

https://codesandbox.io/p/sandbox/romantic-wozniak-y3v44k

Steps to reproduce:

  1. Load the page with the data grid (in the CodeSandbox, in a new tab)
  2. Zoom out in your browser (e.g: Control + mouse scroll wheel)

Please note that the bug is only reproducible for me with CssBaseline included in: https://codesandbox.io/p/sandbox/romantic-wozniak-y3v44k?file=%2Fsrc%2Findex.tsx%3A15%2C22

Current behavior

At some point, the pagination info disappears and a scrollbar appears instead. Please note that the scrollbar only appears at certain zoom levels and it might be browser dependent (tried on Chrome on Windows).

Image

Expected behavior

The pagination info should be visible (though small) at any zoom out level.

Image

Context

I am building a web application that uses a custom theme that suggest using the CssBaseline from MUI. I also have multiple DataGridPro components in my application. I'm trying to avoid this visual bug when users zoom out (zooming out is useful as it allows you to see more columns on screen at the same time).

Your environment

System:
OS: Windows 11 10.0.22631
Binaries:
Node: 22.8.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (127.0.2651.105)
npmPackages:
@emotion/react: 11.11.4 => 11.11.4
@emotion/styled: 11.11.5 => 11.11.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 5.16.4
@mui/icons-material: 5.16.4 => 5.16.4
@mui/material: 5.16.4 => 5.16.4
@mui/private-theming: 5.16.4
@mui/styled-engine: 5.16.4
@mui/system: 5.16.4
@mui/types: 7.2.15
@mui/utils: 5.16.6
@mui/x-data-grid: 7.16.0
@mui/x-data-grid-pro: 7.16.0 => 7.16.0
@mui/x-date-pickers: 6.20.2
@mui/x-date-pickers-pro: 7.16.0 => 7.16.0
@mui/x-internals: 7.16.0
@mui/x-license: 7.16.0
@mui/x-license-pro: 6.10.2 => 6.10.2
@types/react: 18.3.3 => 18.3.3
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: 5.5.3 => 5.5.3

Search keywords: scrollbar CssBaseline
Order ID: 94749

@filipneculciu filipneculciu added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 3, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Oct 3, 2024
@filipneculciu
Copy link
Author

Please note that some members of my team have also noticed some errors in the console:

Image

I couldn't reproduce them, so it might be browser/OS-dependent.

@romgrk
Copy link
Contributor

romgrk commented Oct 3, 2024

I don't see how we can fit the pagination and the scrollbar in this space:

Image

Is the zoom level illustrated there a realistic zoom level for your users? If so, have you considered alternatives such as decreasing the grid content font size?

Regarding the 2nd issue, please open a separate issue with a reproduction case. We can't debug without a reproduction case.

@romgrk romgrk added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 3, 2024
@filipneculciu
Copy link
Author

I don't think the scrollbar should even be there at this zoom level, all the columns are already visible. It doesn't allow you to scroll through anything. If you zoom out even further is disappears, which looks OK:

Image

Please note that we noticed this issue after a major version upgrade the data grid. If I downgrade to v6.18.0 in the example sandbox, it's no longer reproducible for me; it behaves the way I'd expect.

The zoom level where this occurs might be OS/browser dependent. Other people in my team had it occur at different zoom levels and with slightly different behavior; see the following screenshot from a colleague using the same sandbox link I provided:

Image

Here the smaller scrollbar appears in addition to one for the whole table.

I'm not sure if it's realistic for users to work at the zoom level where it occurs for me, it seems borderline usable, but:

  1. It seems like it might happen when less zoomed out depending on circumstances
  2. If users accidentally scroll further than they'd like they will notice it and it will be visually annoying

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 3, 2024
@michelengelen michelengelen changed the title [DataGridPro] Extraneous scrollbar in footer pagination area when using CssBaseline [data grid] Extraneous scrollbar in footer pagination area when using CssBaseline Oct 6, 2024
@michelengelen
Copy link
Member

FYI: I cannot reproduce this in any of the browsers I have installed. neither with the provided sandbox link nor with my local instance running the example from this p[age: Enabling pagination

Might be OS related (I am on MacOS). I'll try it on a windows machine later today as well.

@epicstar
Copy link

epicstar commented Oct 8, 2024

I actually have this issue on my side, too. But I'm not using CssBaseline.... As my datagrid grows, the footer's height decreases. Why? No clue!!!! I'm on v7.19.0.

image

Other than that, I guess my font size is probably bigger than the default mui settings.

Our workaround so far is disabling overflow on the MuiTablePagination-root:

  <DataGrid sx={{
    '.MuiTablePagination-root': {
      overflow: 'hidden',
    },
   }}/>

This doesn't fix the weird footer height change bug, but it completely removes the extremely freaky scrollbar.

@michelengelen
Copy link
Member

@epicstar could you open a separate issue for this please?

@michelengelen
Copy link
Member

michelengelen commented Oct 9, 2024

I could not replicate this on my windows machine using Chrome or Firefox.
@filipneculciu did you apply any custom styling?

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 9, 2024
@filipneculciu
Copy link
Author

@michelengelen I'm not sure what you mean, in the sandbox I have used the sx prop on the Container and Box that surround the data grid (to set sizes, margin and padding) and I have used as mentioned (in index.tsx). But all of this should be visible already in the sandbox code.

In the real app, I'm using the a custom theme, but that's probably not relevant, as it is reproducible for me with just what's in the sandbox. I had 4 colleagues try out the preview link for the sandbox: https://y3v44k.csb.app/ and it was reproducible for all of them (three on them are on Windows 11 and one is on Windows 10).

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 9, 2024
@michelengelen
Copy link
Member

Yes @filipneculciu sry ... I misread that! 🙇🏼
We are investigating, but it is a weird bug and seems more related to the OS/browser combination.
Would you be able to send us a link to the app you are using this in?

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 9, 2024
@cherniavskii
Copy link
Member

Applying the following styles seems to fix the issue:

<DataGrid
  sx={{
    "& .MuiDataGrid-footerContainer": {
      boxSizing: "content-box",
    },
  }}
/>

Here's an updated demo: https://codesandbox.io/p/sandbox/broken-pine-6kr7vq

@filipneculciu Can you confirm that it fixes the issue for you?

@filipneculciu
Copy link
Author

@michelengelen Regarding the link: No, it's not a public website nor are there any publicly accessible demo systems.

@cherniavskii Yes, the "sx" prop you mentioned fixes the issue for me. Could you, please, let me know the plan is for this workaround to no longer be necessary in some future version of MUI X?

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 10, 2024
@cherniavskii
Copy link
Member

@filipneculciu Thanks for the confirmation! I've opened #14911 to address this on our side.

@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 11, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@filipneculciu How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants