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] scroll not working inside modal #14449

Closed
igortas opened this issue Sep 1, 2024 · 4 comments
Closed

[data grid] scroll not working inside modal #14449

igortas opened this issue Sep 1, 2024 · 4 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! customization: logic Logic customizability

Comments

@igortas
Copy link

igortas commented Sep 1, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Create simple modal
  2. Add data grid with adding minHeight and minWidth options and populate the grid with some sample data and wrap inside as box as children
  3. Try to scroll

Current behavior

Scroll not working at all when table is part of a modal, tried on different browsers

Expected behavior

Scroll should work when table is inside modal.

Context

No response

Your environment

System:
OS: Linux 5.15 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
Binaries:
Node: 22.6.0 - ~/.nvm/versions/node/v22.6.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v22.6.0/bin/npm
pnpm: Not Found
Browsers:
Chrome: Not Found
npmPackages:
@emotion/react: ^11.13.3 => 11.13.3
@emotion/styled: ^11.13.0 => 11.13.0
@mui/base: 5.0.0-beta.58
@mui/core-downloads-tracker: 6.0.1
@mui/icons-material: ^6.0.1 => 6.0.1
@mui/lab: ^6.0.0-beta.8 => 6.0.0-beta.8
@mui/material: ^6.0.1 => 6.0.1
@mui/private-theming: 6.0.1
@mui/styled-engine: 6.0.1
@mui/system: 6.0.1
@mui/types: 7.2.16
@mui/utils: 5.16.6
@mui/x-data-grid: 7.15.0
@mui/x-data-grid-premium: ~7.15.0 => 7.15.0
@mui/x-data-grid-pro: 7.15.0
@mui/x-internals: 7.15.0
@mui/x-license: 7.15.0
@mui/x-license-pro: ^6.10.2 => 6.10.2
@mui/x-tree-view: ~7.15.0 => 7.15.0
@types/react: ^18.3.5 => 18.3.5
react: ^18.3.1 => 18.3.1
react-dom: ^18.3.1 => 18.3.1
styled-components: 5.3.11
typescript: ^5.5.4 => 5.5.4

Search keywords: grid scroll modal

@igortas igortas added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 1, 2024
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Sep 1, 2024
@michelengelen
Copy link
Member

To help us diagnose the issue efficiently, could you provide a stripped-down reproduction test case using the latest version? A live example would be fantastic! ✨

For your convenience, our documentation offers templates and guides on creating targeted examples: Support - Bug reproduction

Just a friendly reminder: clean, functional code with minimal dependencies is most helpful. Complex code can make it tougher to pinpoint the exact issue. Sometimes, simply going through the process of creating a minimal reproduction can even clarify the problem itself!

Thanks for your understanding! 🙇🏼

@michelengelen michelengelen added status: waiting for author Issue with insufficient information customization: logic Logic customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 2, 2024
@igortas
Copy link
Author

igortas commented Sep 2, 2024

Hi @michelengelen
I've created simple demo. Take a look, still in the example scrolling not working.
https://codesandbox.io/p/sandbox/nifty-currying-8hcgrm?file=%2Fsrc%2FDemo.tsx%3A120%2C54

@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 Sep 2, 2024
@michelengelen
Copy link
Member

I get it now... you are facing this since the container holding the grid does not have intrinsic dimensions. This necessity is clearly stated in the docs. If you give the modal the dimensions to calculate the render- and scrollerzones it will work as intended:

<Box
  bgcolor="background.paper"
  sx={{
    padding: '1rem',
    position: 'absolute',
    top: '50%',
    left: '50%',
    transform: 'translate(-50%, -50%)',
    width: '95%',
    height: '50vh',
  }}
>
  <DataGrid rows={rows} columns={columns} />
</Box>

@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 Sep 3, 2024
@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 Sep 3, 2024
@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 Sep 3, 2024
@igortas igortas closed this as completed Sep 3, 2024
@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

⚠️ 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.

@igortas: 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! customization: logic Logic customizability
Projects
None yet
Development

No branches or pull requests

3 participants
@igortas @michelengelen and others