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.

Incorrect scroll limit height on Gatsby

See original GitHub issue

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

  1. Setup locomotive scroll on Gatsby
  2. 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:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ZachSauciercommented, Apr 22, 2020

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.

1reaction
abxethcommented, Feb 17, 2020

Hey, can you guys continue this conversation in the issue #13. Thanks.

Read more comments on GitHub >

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

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