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.

childHeight prevents jumps when changing chunks with margin bottom (or top)

See original GitHub issue

I found that when having items with margin bottom the scroller jumps in the exact amount of pixels that I use for margin bottom.

Specifying childHeight, that is the item height + margin bottom is solving this issue.

I saw that childHeight is (DEPRECATED) so I’m assume you will soon stop supporting this attribute.

Please continue supporting childHeight or calculate childHeight with the margin top + bottom.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
speigecommented, May 5, 2019

This should be fixed now & published to npm v2.0.9. Please try it (with margin on your element rather than the padding workaround) & see if it works. You could also try it with both padding & margin.

Closing this as I believe it’s fixed. Please re-open if you continue to have issues.

1reaction
whyboriscommented, Apr 30, 2019

Thank you @Floaz for mentioning that switching from margin to padding may solve some scrolling issues 🙇 – I can confirm that in my project Video Hub App this simple change made scrolling better: https://github.com/whyboris/Video-Hub-App/pull/172

Read more comments on GitHub >

github_iconTop Results From Across the Web

Margin on child element moves parent element - Stack Overflow
This prevents the margins to collapse. Border and padding do the same. Hence, you can also use the following to prevent a top-margin...
Read more >
Everything You Need To Know About CSS Margins
Margin collapsing means that when a heading with a bottom margin, is followed by a paragraph with a top margin, you do not...
Read more >
margin-bottom - CSS: Cascading Style Sheets - MDN Web Docs
The margin-bottom CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, ......
Read more >
codemirror.js - Apple Open Source
scrollTop; top = Math.floor(top - paddingTop(display)); var bottom ... Tries to bail out early when no changes are needed, // unless forced is...
Read more >
Owner's manual - CUPRA
How do you top up the windscreen washer fluid? ››› page 325 ... Changing the windscreen wiper blades . ... be pressed down...
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