Incorrect scroll limit height on Gatsby
See original GitHub issueDescribe the bug
Page height is incorrectly measured by LS and so the scroll ends too early or a bit after the content ends.
On deeper inspection, it seems that the limit
on the scroll instance gets an incorrect value on initializing. I’ve tried fixing this by adding an update()
call after a timeout to no avail.
To Reproduce Steps to reproduce the behavior:
- Setup locomotive scroll on Gatsby
- Add content to page and scroll
I’ll attempt to provide a demo reproducing the error later, but if anyone has a CodeSandbox to show the issue that’d be great (cc @flowen)
Expected behavior
The scroll should happen till page end not before or after: technically the right value set to limit
Desktop (please complete the following information):
- OS: MacOS Catalina
- Browser: Chrome
- Version 80
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How to add a scroll event to a header in Gatsby
The easiest way is by creating a custom hook to track the current scroll position. Something like this: import { useLayoutEffect, useRef } ......
Read more >How To Fix Cumulative Layout Shift (CLS) Issues
I've written about this before, but one of the easiest things you can do to reduce CLS is to ensure you have width...
Read more >Preventing Content Reflow From Lazy-Loaded Images
When a user scrolls and images are lazy-loaded, those img elements go from a height of 0 pixels to whatever they need to...
Read more >Gatsby Image plugin
It displays the image at the size of the source image, or you can set a maximum size by passing in width or...
Read more >How to Automatically Optimize Responsive Images in Gatsby
Fluid: image with maximum width, and possibly height. Fixed is useful if you want to display retina images. Note that scroll bars will...
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
I’m seeing this problem (without Gatsby or any library) only on iOS. I’m guessing I should make a new thread?
Edit: Adding
smoothMobile: true
fixes it for me.Hey, can you guys continue this conversation in the issue #13. Thanks.