question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Box with full={true} attribute gets the size of whole window, ignoring header and footer size

See original GitHub issue

I 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:

  1. Header at top
  2. The TODO app component
  3. 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

  1. Generate sample app (grommet new sample-app)
  2. Surround the TodoAppDashboard component with Box that has the full={true} propery.
<Box full={true}>
  <TodoAppDashboard />
</Box>
  1. 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:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alansouzaticommented, Sep 20, 2016

Full will use the entire viewport width as described in here:

https://grommet.github.io/docs/box

Whether the width and/or height should take the full viewport size.

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}/>

0reactions
dhampikcommented, Sep 1, 2017

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found