-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-react-router-scroll changes resulting in fail of gbi in Chrome #26481
Comments
Hi there, any news on this one? Best, Tim. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Still nothing : /? |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Hi there, any plans/updates on this issue? |
Description
Two weeks ago I got a new bug-report in
gatsby-background-image
, #125. With the changes from PR #24306gbi
gets called again after its ownIntersectionObserver
kicks in when scrolling down, which results in its given image getting loaded again for normal & adaptive images, stacked images seem to work.Only setting
critical
"rectifies" the repeated image loading, but that isn't a functional workaround in the long run.And I guess in some cases this might happen for
gatsby-image
as well, but I didn't look into it.The "offending line" in the compiled output is the initialization (number 34 in
scroll-handler.js
):I couldn't disable the behavior with a
shouldUpdateScroll
in agatsby-browser.js
, or should this even be possible like this?The workarounds from other issues like setting
"resolutions"
to"gatsby-react-router-scroll": "3.0.0"
didn't work either.Or is there any other way to prevent the
ScrollHandler
from interruptinggbi
s flow (or a thing I might be able to change)?Any help would be highly appreciated!
Steps to reproduce
Adding a placeholder
div
in front of aBackgroundImage
component, putting it below the fold and kicking off theIntersectionObserver
(like the OP in #125 did):Without setting
critical
on theBackgroundImage
the image loads twice / trice.I created a reproduction branch in
gbitest
, the demo repo ofgbi
, called scroll-handler-bug. The div was added here and the relevant component isBackgroundSection
.Expected result
Image gets loaded only once.
Actual result
The
scroll
event handler kicks in and forcesBackgroundImage
to rerender, which results in multiple image load events:Environment
I also tested it with node v12.18.0 with sadly the same result.
And I of course know
gbi
is no core component of gatsby, but any help would be greatly appreciated!The text was updated successfully, but these errors were encountered: