Skip to content

[EuiDataGrid] Grid grows to infinite height in flex container if height not provided #7769

Open

Description

Describe the bug
Using an EuiDataGrid within a <EuiFlexGroup direction='column'> with a sibling component will cause a feedback loop of some kind whereby the DataGrid will grow infinitely.

datagrid-height.mp4

Impact and severity
A component tree as simple as this completely breaks the entire page (pseudocode):

<EuiFlexGroup direction="column">
  <EuiFlexItem>
    <EuiPanel>
      <EuiSearchBar />
      <EuiDataGrid />
    </EuiPanel>
  </EuiFlexItem>
</EuiFlexGroup>

The fix is to simply specify a height on the Data Grid:

<EuiFlexGroup direction="column">
  <EuiFlexItem>
    <EuiPanel>
      <EuiSearchBar />
-     <EuiDataGrid />
+     <EuiDataGrid height="auto" />
    </EuiPanel>
  </EuiFlexItem>
</EuiFlexGroup>

You could also simply wrap the Data Grid in a non-flex container:

<EuiFlexGroup direction="column">
  <EuiFlexItem>
    <EuiPanel>
      <EuiSearchBar />
+      <div>
          <EuiDataGrid />
+      </div>
    </EuiPanel>
  </EuiFlexItem>
</EuiFlexGroup>

Environment and versions

  • EUI version: latest
  • React version: latest
  • Browser: Chrome (at least)
  • Operating System: all

Minimum reproducible sandbox

Additional context
If the bug is "too deep" to fix, as suggested in the thread, it maybe be useful to require a height prop,or at least call this out in the docs. Thanks for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions