[EuiPageTemplate] Add support for fullHeight layouts#4793
[EuiPageTemplate] Add support for fullHeight layouts#4793cchaos merged 23 commits intoelastic:masterfrom
fullHeight layouts#4793Conversation
…es for consumers
…ull-height # Conflicts: # src-docs/src/views/utility_classes/utility_classes_overflow.js
| @@ -1,5 +1,43 @@ | |||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | |||
|
|
|||
| exports[`EuiPageTemplate fullHeight is rendered with noscroll 1`] = ` | |||
There was a problem hiding this comment.
Does anyone know how to get hooks to work in tests? I can never seem to get useIsWithinBreakpoints() to return true in tests.
There was a problem hiding this comment.
Haven't dug into it, but I think I've faced similar issues with around breakpoints in tests and it's because the window object is all gummed up. You'd need to mock whatever browser APIs you need to get it to work...
| 'empty', | ||
| ] as const; | ||
|
|
||
| type _EuiPageTemplateTypes = ExclusiveUnion< |
There was a problem hiding this comment.
I removed this exclusive union because it really messes with consuming applications when they try to be wrappers of this component.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
Removed default `main` as the component for EuiPageBody
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
Moved this from Sass to `style` tag for easier manipulation
|
@snide Thanks! Good catch on the sidebar padding. That was a last minute addition that I forgot to check the manual component versions for. Pushed all the changes! |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
|
Jenkins, test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
snide
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the changes.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4793/ |

Added
fullHeightprop to EuiPageTemplateOnly if
templatetype is 'empty' or 'default'.This is essentially to help with layouts like in Kibana's Dev Tools application where the app is the full window height and the inner panels scroll individually. The new prop will extend the height of each child element to
height: 100%and cut off overflows. There are three options for this new prop:false: default : Behaves as it does today and relies on the body overflow for scrollingtrue: Extends the height, but does add scrolling to the EuiPageContentBody component'noscroll': Extends the height and removes all scrolling ability. Consumers must add it to a child componentThere is a slight backup just in case of weird edge cases, like if the height of the browser is too small, a scroll will kick in. This could mean that there's double scroll but at least the content won't get cut off.
Also added
minHeightprop directly to EuiPageTemplate to control the forced scrolling in case the window is very short.Other updates added to help with this
Added
.eui-fullHeightandeuiFullHeight()utilitiesAdded
paddingSizeto EuiPageSideBarAdded
flex-shrink: 0to EuiTabs, EuiSpacer, and EuiImageIf these ever ended up being a direct descendent of a
flexcontainer, there was a good possibility they could shrink smaller than their actual height. This is now prevented.Fixed duplicate
mainaria roles in the EuiPageTemplate and other common EuiPage patternsBy changing the default
componentof EuiPageBody frommaintodivand keepingrole=mainon EuiPageContent.Fixed text color of EuiBottomBar
It was using
emptycolor instead ofghost.Checklist
[ ] Checked for breaking changes and labeled appropriately