childHeight prevents jumps when changing chunks with margin bottom (or top)
See original GitHub issueI 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:
- Created 5 years ago
- Comments:12
Top 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 >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
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.
Thank you @Floaz for mentioning that switching from
margin
topadding
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