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

[DataGrid] Rows content disappear on display size change #1908

Closed
ru4ert opened this issue Jun 15, 2021 · 4 comments
Closed

[DataGrid] Rows content disappear on display size change #1908

ru4ert opened this issue Jun 15, 2021 · 4 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement

Comments

@ru4ert
Copy link

ru4ert commented Jun 15, 2021

Youtube Video

DataGrid content disappears when "Material Grid" forces a Grid change.

Current Behavior 😯

Expected Behavior 🤔

Maybe I want to see it, too? 🤔

Steps to Reproduce 🕹

const rows:GridRowModel[] = Object.keys(values.Members).map(key => {
    return {
        name: values.Members[key].name,
        role: values.Members[key].role,
        type: values.Members[key].type,
        dedicated: values.Members[key].dedicated,
        fulltime: values.Members[key].fulltime,
        hasShares: values.Members[key].hasShares,
        linkedInLink: values.Members[key].linkedInLink,
        stockOptionProgram: values.Members[key].stockOptionProgram,
        id: values.Members[key]._id,
    }
}) 
return (
          <DataGrid
          rows={rows}
          columns={columns}
          components={{
              Toolbar: GridToolbar,
          }}
          onEditCellChange={onEdit}
          onSelectionModelChange={onSelect}
      />
)

Your Environment 🌎

tsconfig

{
  "compilerOptions": {
    "target": "ES2020",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "noImplicitAny": false,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": [
    "src"
  ]
}
`npx @material-ui/envinfo`

System:
OS: Windows 10 10.0.19043
Binaries:
Node: 14.17.0 - C:\Program Files (x86)\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.13 - C:\Program Files (x86)\nodejs\npm.CMD
Browsers:
Chrome: Not Found
Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.48)
npmPackages:
@emotion/react: ^11.4.0 => 11.4.0
@emotion/styled: ^11.3.0 => 11.3.0
@material-ui/core: ^4.11.2 => 4.11.4
@material-ui/data-grid: ^4.0.0-alpha.31 => 4.0.0-alpha.31
@material-ui/icons: ^4.11.2 => 4.11.2
@material-ui/lab: ^4.0.0-alpha.58 => 4.0.0-alpha.58
@material-ui/styles: 4.11.4
@material-ui/system: 4.11.3
@material-ui/types: 5.1.0
@material-ui/utils: 4.11.2
@types/react: ^17.0.8 => 17.0.8
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.3.2 => 4.3.2

@ru4ert ru4ert added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 15, 2021
@dtassone
Copy link
Member

Please provide a minimal reproduction test case with the latest version. This would help a lot 👷 .
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

@dtassone dtassone 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 Jun 15, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 15, 2021

@dtassone The link to codesandbox is not working. Please save this as a "saved reply" .

Please provide a **minimal** reproduction test case with the latest version. This would help a lot 👷 .
A live example would be perfect. [This **codesandbox.io** template](https://material-ui.com/r/issue-template) _may_ be a good starting point. Thank you!

I have updated https://www.notion.so/GitHub-issues-PRs-c1d7072e0c2545b0beb43b115f6030f6 to help.

Capture d’écran 2021-06-15 à 21 22 18

Also, the video provided is self-explanatory. I'm moving forward with a direct answer.

@oliviertassinari
Copy link
Member

@Rupert-com The parent of the data grid needs to have an intrinsic height, see https://material-ui.com/components/data-grid/layout/.

@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Jun 15, 2021
@oliviertassinari oliviertassinari changed the title DataGrid rows content disappear on display size change [DataGrid] Rows content disappear on display size change Jun 15, 2021
@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement and removed status: waiting for author Issue with insufficient information labels Jun 15, 2021
@ru4ert
Copy link
Author

ru4ert commented Jun 15, 2021

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants