Box with full={true} attribute gets the size of whole window, ignoring header and footer size
See original GitHub issueI am trying to implement sticky footer, by wrapping the TodoAppDashboard component in a Box component that has full={true} property (some code removed for brevity):
<App>
<Header/>
<Box full={true}>
<TodoAppDashboard />
</Box>
<Footer/>
</App>
Expected Behavior
I expect to see the following things in the browser window:
- Header at top
- The TODO app component
- Footer at the bottom
This is based on the assumption that the box height will be calculated by the equation: ‘’‘Screen.height - Header.height - Footer.height’‘’
Actual Behavior
I see all the components as expected, except that the height TODO app component is higher than expected. It seems as if the value is taken from ‘’‘Screen.height’‘’, ignoring ‘’‘Header.height’‘’ and ‘’‘Footer.height’‘’.
Steps to Reproduce
- Generate sample app (grommet new sample-app)
- Surround the TodoAppDashboard component with Box that has the full={true} propery.
<Box full={true}>
<TodoAppDashboard />
</Box>
- Start the app (gulp dev) and open the browser
Your Environment
- Grommet version: 0.1.5
- Browser Name and version: Firefox 48.0 and Google Chrome 53.0.2785.113 (64-bit)
- Operating System and version (desktop or mobile): Ubuntu 16.04 desktop (updated), x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Resolve a Fluid Header/Footer Problem When the ...
The problem happens under the following circumstances: (1) The header and footer of the page have no specified width; (2) The content area...
Read more >content 100% height to window height - Stack Overflow
No. Header and content scrolling when content text is bigger than window height (footer always fixed), and content height fit to window height...
Read more >how do I reduce the size of a header or footer in Office 365
The Header and footer on my documents take up too much vertical space. Is it possible to reduce the vertical size of the...
Read more >Video: Headers and footers - Microsoft Support
This video is all about changing the margin of the headers and footers, without affecting the rest of the document. Change the header...
Read more >Edit your existing headers and footers - Microsoft Support
Change your document's header or footer text, remove the first page header ... To change the font, color or size Select the text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Full will use the entire viewport width as described in here:
https://grommet.github.io/docs/box
Are you looking for a floating footer? Always visible the the bottom of a view port?
If yes, we support it:
<Footer float={true} fixed={true}/>
I guess when people want to have sticky footer, they usually mean a footer that is stuck at the bottom when there is not much content on the page and pushed down with content when the content is big enough. A lot of ways how to implement the sticky footer can be found at CSS-Tricks.
In case if anyone looking for a real sticky footer sample for grommet - here it is! @alansouzati, maybe you can propose a more elegant solution without using custom css?