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] Data grid overflows in flex box #2618

Closed
walterra opened this issue Dec 10, 2019 · 2 comments
Closed

[Data Grid] Data grid overflows in flex box #2618

walterra opened this issue Dec 10, 2019 · 2 comments

Comments

@walterra
Copy link
Contributor

walterra commented Dec 10, 2019

The data grid will overflow in flex structures:

image

Within EuiFlexItem, the data grid only adapts to the container width if the flex item has a hard coded width. If the width is not set or a percentage, data grid will outgrow it.

Expected behavior: The data grid should not outgrow the parent container.


See this codesandbox to reproduce the issue: https://codesandbox.io/s/euidatagrid-1-6yedq?fontsize=14&hidenavigation=1&theme=dark


In this Kibana PoC I worked around it by tracking the width of the parent element and setting it via JavaScript but it's unfortunate that that's needed.

@snide
Copy link
Contributor

snide commented Jan 2, 2020

You'll need a maxwidth for the EuiFlexItem that contains the grid. EuiDataGrid requires a container with some manner of limits for the scrolling to know when to kick in. Please close if this fixes your issue.

Codesandbox here: https://codesandbox.io/s/euidatagrid-2-flex-width-bug-wxyph

image

@snide snide added the :urgent: label Jan 2, 2020
@walterra
Copy link
Contributor Author

walterra commented Jan 8, 2020

Thanks for the update! In our case the left container has a fixed width and we want the data grid to use up the available rest of the width. So first I thought that's then an edge case we cannot cover with pure CSS. But calc() to the rescue! If I do a max-width: calc(100% - 480px) where 480px is the fixed width of the left container, the data grid uses up the available space. Thanks for investigating, closing this one.

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

No branches or pull requests

2 participants