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

React: Virtual Slides + Parallax Animation does not always work correctly #4673

Closed
kije opened this issue Jun 13, 2021 · 1 comment
Closed
Labels

Comments

@kije
Copy link

kije commented Jun 13, 2021

  • Swiper Version: 6.7.0
  • Platform/Target and Browser Versions: macOS, Chrome 91.0.4472.101

What You Did

I created a Swiper slider with virtual slides & Parallax transition enabled.
Now when using swiper.slideNext() or swiper.slidePrev() to go to the next/previous slide, the parallax animation sometimes (in fact, most of the time) does not work correctly. Instead of animating both the "outgoing" and the "incoming" slide, it only animates the outgoing slide.

The issue occurs only the first time the rendered slide is animated to. E.g. if I transition to the 2nd slide the first time, the animation is broken. If I then transition back to the 1st slide (which was previously rendered), the animation works correctly.

https://codesandbox.io/s/floral-darkness-nqdqr?file=/src/App.js

Expected Behavior

I would expect that the parallax animation works regardless of which slide the transition is animating to, and regardless of whether virtual slides are used or not.

Actual Behavior

To better illustrate, I made a screen recording of the code example (see above) showing the issue.

screen-recording-2021-06-13-at-214625_DROatQFL_pNKY.mp4

Some slides are animated correctly (both slides have a parallax animation), but on other slides, only one of the slides is animated. It seems like the issue manly occurs when a slide is first added to the dom and has not yet been animated to/from. If the slide has already been once animated to/from (and in the meantime was not removed from the DOM again due to the "virtual slides" features), the animation is performed correctly.

@mmd550
Copy link

mmd550 commented Mar 17, 2024

I still have this issue with cube effect and virtual slides :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants