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.

Preventing other elements from crashing into a fixed footer

See original GitHub issue

I have a document that has a fixed footer on all pages, but elements before the footer sometimes crash or overlap into it. This is because such elements can only wrap when it is calculated that they can’t make the rest of the page without the height of the footer being taken into consideration.

<Document>
    <Page size={{ height: 472 }}>
        <View height={410}></View> // element won't wrap because it's height is not up to the page and crashes into the absolutely fixed footer below
        <View height={72} style={{ position: 'absolute', bottom: 0, left: 0, right: 0 }}></View> // fixed footer
    </Page>
</Document>

I could use the break prop for such elements but there is no way to dynamically determine when to apply it.

Is there a way to prevent this from happening?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

8reactions
idrisadetunmbicommented, Dec 1, 2019

For anyone with a similar situation, I had to give the Page a padding-bottom higher than the height of the footer.

2reactions
santig1399commented, Jul 14, 2021

I have the same issue but the padding-bottom doesnt work for me. The elements before the fixed footer still remain overlaping. Is there another way to prevent this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preventing fixed footer from overlapping content
The problem is that fixed position takes it out of document flow. You can add margin-bottom to the body content equal to the...
Read more >
HOW to keep your FOOTER at the bottom of the page with CSS
I explain how to keep your footer element stuck to the bottom of the page with CSS. The problem occurs when you have...
Read more >
How to Stop Word from Crashing! - 24 Hour Company
1) Check the Header/Footer First. Headers and footers are awesome because every page references only one set of text or images. · 2)...
Read more >
How to keep your footer where it belongs ? - freeCodeCamp
For a quick fix, you can absolutely position the footer at the bottom of the page. But this comes with its own downside....
Read more >
The box model - Learn web development | MDN
Padding, margin and border will cause other elements to be pushed away from the box. The box will extend in the inline direction...
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