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

When 'previous/next slide' buttons are inside slider and if clicked on next slide button, the slider is moving to previous slide on tab/window switch #7406

Closed
5 of 6 tasks
eswar-janjanam opened this issue Mar 21, 2024 · 3 comments · Fixed by Mapuppy09/tradetrust-website#8 · 4 remaining pull requests
Labels
t0ggles Linked to the t0ggles task

Comments

@eswar-janjanam
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-css-mode-forked-4qc5hv

Bug description

When the buttons for moving the slides back and forth are inside the slider and the user clicks on the button for moving to next or previous slide, the slide is moving to next or previous slide accordingly. But after the slide is changed, if the user switches browser tab / browser window and coming back to the tab/window containing swiper, the slider is moving back to previous slide from where the button is clicked.

Steps to reproduce:

  1. Click on 'Next' button in Slide 1. The slider will go to Slide 2.
  2. Do a tab switch / window switch and come back to the swiper tab.
  3. Observe the slide number. It is coming back to Slide 1 from where the button is clicked.
  4. Similarly, click on 'Next' button in Slide 1.
  5. In Slide 2, click on 'Previous' button. It will go to Slide 1.
  6. Do a tab switch / window switch and observe the slide number.
  7. It should be on Slide 1, but it is moving to Slide 2 from where the button is clicked.

Expected Behavior

The slider should stay in the same slide instead of moving to previous slide on tab/window switch.

Actual Behavior

The slider is moving to previous slide instead of staying in the same slide on tab/window switch.

Swiper version

11.0.3

Platform/Target and Browser Versions

macOS chrome 122.0.6261.129

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
@nolimits4web
Copy link
Owner

t0ggles-create swiper

Copy link

t0ggles bot commented Mar 21, 2024

Task nolimits4web/SWIPER-78 was created

t0ggles task SWIPER-78

@eswar-janjanam eswar-janjanam changed the title [LINK UPDATED] When 'previous/next slide' buttons are inside slider and if clicked on next slide button, the slider is moving to previous slide on tab/window switch When 'previous/next slide' buttons are inside slider and if clicked on next slide button, the slider is moving to previous slide on tab/window switch Mar 22, 2024
Copy link

t0ggles bot commented Mar 28, 2024

Task nolimits4web/SWIPER-78 status changed to Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment