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

EuiTabs can break layouts #3373

Closed
gjones opened this issue Apr 22, 2020 · 8 comments · Fixed by #3375
Closed

EuiTabs can break layouts #3373

gjones opened this issue Apr 22, 2020 · 8 comments · Fixed by #3375
Labels

Comments

@gjones
Copy link
Contributor

gjones commented Apr 22, 2020

Summary
When you have a number of EuiTabs, they do not honour the width of their parent and instead force their own width. This can lead to weird behaviour on smaller screens.

Here's an example of the Elastic Cloud layout being forced to horizontal scroll.

Screen Recording 2020-04-22 at 12 00 pm

and here's how it affects the EUI docs themselves.

Screenshot 2020-04-22 at 12 02 11


Here's a related issue filed in Elastic Cloud https://github.com/elastic/cloud/issues/46807

@gjones gjones added the bug label Apr 22, 2020
@snide
Copy link
Contributor

snide commented Apr 22, 2020

Can you give us an example on how to replicate?

When given a parent of 300px, I'm seeing the overflow?

image

@snide
Copy link
Contributor

snide commented Apr 22, 2020

Ah. I see the issue now.

@snide
Copy link
Contributor

snide commented Apr 22, 2020

This is not a problem with the tabs themselves, but the container. Essentially, because of the flex, you'll need to make sure you have a max-width:100% on the parent containers to let the flex in tabs know it can't exceed a certain size (in this case, the full page).

You can fix this on the docs by applying the following

image

@cchaos can you see any downside to applying max-width: 100% to euiPageBody? If not, I think we could likely safely solve this problem for common occurances (not all!) of this class of problems. @gjones since every page layout is different, you might find you need to apply a similar styling property to any parent containers cloud uses.

@elizabetdev
Copy link
Contributor

@snide the same issue happens on this page: https://elastic.github.io/eui/#/display/code. I think it was introduced with the whiteSpace="pre".

Applying max-width: 100% to euiPageBody as you suggested fix this issue too.

@bevacqua
Copy link
Contributor

@snide's fix seems beautiful

@gjones
Copy link
Contributor Author

gjones commented Apr 22, 2020

Looks good Dave, thanks! So is this something you (eui team) would apply to the euiPageBody itself? Or is it something we should add at the cloud level?

Meaning, should we (cloud) fix it, or wait for an eui level fix, then upgrade?

@elastic elastic locked and limited conversation to collaborators Apr 22, 2020
@elastic elastic unlocked this conversation Apr 22, 2020
@bevacqua
Copy link
Contributor

I don't see a reason not to add this to EUI itself

@snide
Copy link
Contributor

snide commented Apr 22, 2020

I'll make a PR for @cchaos to review.

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

Successfully merging a pull request may close this issue.

4 participants