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] Column with flex=1 generates a new column #15489

Open
DanielaDark opened this issue Nov 19, 2024 · 6 comments
Open

[data grid] Column with flex=1 generates a new column #15489

DanielaDark opened this issue Nov 19, 2024 · 6 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! customization: extend Logic customizability feature: Rendering layout Related to the data grid Rendering engine support: commercial Support request from paid users

Comments

@DanielaDark
Copy link

DanielaDark commented Nov 19, 2024

The problem in depth

Link to Sandbox
Please see sandbox for specific implementation. In short: we use the DataGrid without column headers and only with 1 Column. The column:

  • is a custom GroupingColumn
  • the GroupingColumn has Property Flex=1
  • has treeData activated

The container where DataGridPremium is embedded has no set height (for example a MUI Popover).

Expected behavior:
DataGrid is displayed correctly. When elements are expanded, container grows in height, when elements are collapsed - container shrinks. No extra Cells are displayed.

Actual behavior
An extra cell is added in each row thought flex=1 property is set.
grafik

Note: The extra cell disappears when container is given a height Property (for example in demo.tsx line 174)

Motivation: I wanted to use the Grid Component in a Popover, which has flexible height based on the contents.

Your environment

`npx @mui/envinfo`
  Browser: Firefox
    System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 14.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD  
    pnpm: Not Found
  Browsers:
    Chrome: 131.0.6778.70
    Edge: Chromium (131.0.2903.51)
  npmPackages:
    @emotion/react: ^11.10.6 => 11.11.4 
    @emotion/styled: ^11.10.6 => 11.11.5
    @mui/base:  5.0.0-alpha.124
    @mui/core-downloads-tracker:  5.15.18
    @mui/icons-material: 5.11.16 => 5.11.16
    @mui/lab: 5.0.0-alpha.125 => 5.0.0-alpha.125
    @mui/material: 5.11.16 => 5.11.16
    @mui/private-theming:  5.15.14
    @mui/styled-engine:  5.15.14
    @mui/styles: 5.11.16 => 5.11.16
    @mui/system:  5.15.15
    @mui/types:  7.2.14
    @mui/utils:  5.15.14
    @mui/x-data-grid:  6.9.2
    @mui/x-data-grid-premium: 6.9.2 => 6.9.2
    @mui/x-data-grid-pro:  6.9.2
    @mui/x-license-pro:  6.9.0
    @types/react: ^18.0.26 => 18.3.2
    react: ^18.2.0 => 18.3.1
    react-dom: ^18.2.0 => 18.3.1
    typescript: 4.4.3 => 4.4.3

Search keywords: DataGrid width
Order ID: 99555

@DanielaDark DanielaDark added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Nov 19, 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 Nov 19, 2024
@michelengelen
Copy link
Member

Hey @DanielaDark ... your codesandbox is set to private. Could you change the permission on it so we can have a look at that as well? Thanks! 🙇🏼

@michelengelen michelengelen added status: waiting for author Issue with insufficient information feature: Rendering layout Related to the data grid Rendering engine customization: extend Logic customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 19, 2024
@michelengelen michelengelen changed the title [question] In DataGridPremium flex=1 generates a new column [data grid] Column with flex=1 generates a new column Nov 19, 2024
@DanielaDark
Copy link
Author

@michelengelen, sorry my bad. Now it should be public.

@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 Nov 19, 2024
@michelengelen
Copy link
Member

Hey @DanielaDark ... it's not showing that extra cell for me:
Screenshot 2024-11-19 at 15 55 33

@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 Nov 19, 2024
@DanielaDark
Copy link
Author

Hey @michelengelen, I really don't know, why it is not displayed for you. I checked the Link in Edge, Chrome and Firefox. My colleges checked it. We all have the extra cell in display.
grafik

@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 Nov 20, 2024
@michelengelen
Copy link
Member

This is indeed interesting. I did test this on browserstack (Win 10 and Chrome 131) and there I can see the additional cell. I do not have a windows10 machine at hand to bugfix, but will see if we can somehow do this anyways.

Screenshot 2024-11-20 at 09 33 30

Thanks for creating the issue! 🙇🏼

@michelengelen michelengelen added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 20, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Nov 20, 2024
@michelengelen
Copy link
Member

I just tried again with the latest grid version and there it works.
Would updating the grid version be an option for you?

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: extend Logic customizability feature: Rendering layout Related to the data grid Rendering engine support: commercial Support request from paid users
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

2 participants