Skip to content
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

Embla + Framer Motion + Flubber makes slides "disappear" #317

Closed
Tracked by #298
MartinConde opened this issue May 25, 2022 · 5 comments
Closed
Tracked by #298

Embla + Framer Motion + Flubber makes slides "disappear" #317

MartinConde opened this issue May 25, 2022 · 5 comments
Labels
bug Something isn't working resolved This issue is resolved

Comments

@MartinConde
Copy link

Bug is related to

Using Embla in combination with Framer Motion and Flubber

Embla Carousel version

  • v6.2.0

Describe the bug

Not really a bug, more like something I can't seem to figure out.

Basically, I've got images with a clippath inside my slides. When a slide becomes active, the clippath transitions to another shape using flubber and framer motion. This part works just fine.

The issue is that slides become "invisible" at times but show up after a second or so. While sliding through, slides will be dropped and re-appear. If I comment out the svg, the sliding works perfectly again.

I've tried playing with re-initting the slider at different points but can't figure out where I'm going wrong. I'm aware that this issue isn't emblas "fault" but figured I'd ask in case someone has an idea.

CodeSandbox

https://codesandbox.io/s/embla-framer-test-llgvds?file=/src/components/EmblaCarousel/slide.js

Steps to reproduce

  1. Checkout the CodeSandbox, preferably in full screen mode so it's easier to see the issue with the transitions.
  2. Open slide.js and remove or comment out the svg (marked with a comment in the code)
  3. Re-open CodeSandbox in full screen mode and see the difference

Expected behavior

Slides shouldn't drop/disappear, basically all should work like it does when the svg is removed

@MartinConde MartinConde added the bug Something isn't working label May 25, 2022
@davidjerleke
Copy link
Owner

davidjerleke commented May 30, 2022

Hi @MartinConde,

Look at this:
The upcoming version 7 of Embla seems to solve this. I've created a CodeSandbox with the v7 release candidate and the slide disappearing isn't happening.

I'm guessing that both Embla is manipulating elements when looping slides, and Framer Motion + Flubber is also doing that so some things were conflicting because of this. It's worth noting that v6 is working fine without Framer Motion + Flubber so this can probably be solved with v6 if you were to change the order of doing things.

Embla v7 uses px as unit instead of %. Maybe the absolute px unit is more resilient towards multiple libraries manipulating elements and reading their rects etc. One thing that's clear though is that it's beneficial for this case. Here's the specification for v7:

Best,
David

@MartinConde
Copy link
Author

Hi @davidjerleke

Awesome thanks a lot, guess I'll just go for v7 then. Would love to figure out the solution in v6 but been fiddling with it a lot and no patience for now to keep trying if v7 fixes it perfectly.

@davidjerleke davidjerleke added upcoming A feature or bug fix is on its way for this issue v7 labels May 30, 2022
@davidjerleke
Copy link
Owner

I'm keeping this open until the release of:

@davidjerleke davidjerleke reopened this May 30, 2022
@davidjerleke davidjerleke mentioned this issue May 30, 2022
13 tasks
@davidjerleke
Copy link
Owner

Hello @MartinConde,

If you're interested: v7.0.0-rc01 has been released.

Cheers,
David

@davidjerleke
Copy link
Owner

Released with v7.

@davidjerleke davidjerleke added resolved This issue is resolved and removed upcoming A feature or bug fix is on its way for this issue labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved
Projects
None yet
Development

No branches or pull requests

2 participants