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

Autoplay stops on all but one swiper when the browser is resized #6590

Closed
5 of 6 tasks
ZMcWilliam opened this issue Apr 17, 2023 · 1 comment
Closed
5 of 6 tasks

Autoplay stops on all but one swiper when the browser is resized #6590

ZMcWilliam opened this issue Apr 17, 2023 · 1 comment

Comments

@ZMcWilliam
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codepen.io/zmcwilliam/pen/abRZzJp

Bug description

When multiple swipers have been initialised on the page and the window is resized by the user, only one of the swipers will continue autoplaying, the rest of the swipers will be set to a paused state.

They can be resumed with .autoplay.resume() successfully, but they should not need this in the first place as the swiper was never paused.

Expected Behavior

All swipers on the page continue to autoplay after the browser window has been resized

Actual Behavior

Only the most recently initialized swiper will continue to autoplay, and any other swiper will pause itself.

Swiper version

9.2.2

Platform/Target and Browser Versions

All (Tested on Windows 10 and Ubuntu 22.04.2 -> Chrome 111.0.x)

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@oalexdoda
Copy link

This is still happening for us @nolimits4web - see this page here as an example (the 3 sliders right below the welcome section): https://www.agent.so/ask/software-developer

Here's the config for that slider:
https://privatebin.net/?99969a763f733d3a#BiFr9bzaZFZ7c1Ag6dp8a8tdqF5c6dCqy12p6cED5BY2

Any quick workarounds on how to fix it? Tried a combination of resize event listeners, initialize/destroy the slider, etc. and nothing seems to work.

Additionally, after the slider completes a cycle it will just stop. Which is an ever bigger problem because people won't ever get to see the content outside the viewport once it does.

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

No branches or pull requests

2 participants