Closed ardiewen closed 2 years ago
Hi @ardiewen,
I only had 2 minutes to do some debugging but I found this: It seems like the artDirection
image is being re-rendered whenever you drag the carousel and release the pointer, but Embla is not being re-rendered. You can reproduce this like so:
<picture>
element in order to show its contents.picture
element being removed and added again.Another thing: The console is throwing a couple of errors so these maybe worth investigating a bit:
At this point I have no idea why this is happening though.
Best, David
Hey @davidjerleke thanks for your prompt response! I managed to isolate the issue.
I first thought it had to do with the transform animation, but it looks like any re-render of the parent container will cause an art directed image to also rerender, even if it's been loaded.
This is not the case with the regular GatsbyImage. Rerendering parent containers will not cause a child GatsbyImage to rerender once its been loaded.
I'll create an issue on the gatsby repo.
Hi @ardiewen,
Glad to hear that. Let’s hope that they will fix the issue soon. Good luck with everything 👍🏻.
Best, David
Bug is related to
Embla Carousel version
Describe the bug
GatsbyImage
component is used with the carousel, it works fine (images load when they enter the view port).GatsbyImage
is usedwithArtDirection
with the carousel, the images load fine, but then "flicker" every time the carousel is dragged.withArtDirection
WITHOUT the carousel works fine, e.g. anoverflow: scroll
container with some of the images out of viewportCodeSandbox
https://codesandbox.io/s/broken-butterfly-ltxgv
I first noticed this when testing React18 but also reproduced in React17. Here's a minimal repro on a react17 branch: https://github.com/ardiewen/gatsby-image-react18-repro/tree/react17
Steps to reproduce
Expected behavior
artdirection.js
and disable the ref and change the overflow to scroll, it behaves as it should (no flickering).Additional context