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

Incorrect Behavior of autoScrollOffset Parameter in Swiper When Switching Thumbnails #7457

Open
5 of 6 tasks
SerhiiStepanenko opened this issue Apr 11, 2024 · 1 comment
Open
5 of 6 tasks
Labels

Comments

@SerhiiStepanenko
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/incorrect-behavior-of-autoscrolloffset-parameter-in-swiper-when-switching-thumbnails-vqx7qg?file=%2Fsrc%2FModalSlider.js%3A165%2C33

Bug description

In Swiper, the autoScrollOffset parameter is used to automatically scroll thumbnails by a specified number of slides from the edge upon their activation. According to the documentation, setting it to a value, for example, 1, should result in automatic scrolling of thumbnails when the last visible thumbnail (1 position from the edge) gets activated. However, the switching of thumbnails does not adhere to the defined autoScrollOffset value, leading to incorrect positioning of thumbnails post-activation.

Uploading WFTU3831.MP4…

Expected Behavior

It is expected that setting the autoScrollOffset parameter with a certain value will prompt Swiper to automatically scroll the thumbnails by the specified number of positions from the edge upon their activation. This should ensure smooth and intuitive navigation through the thumbnails, allowing users to always view the active thumbnail in the context of its surrounding slides, thus enhancing visual interaction and navigation.

Actual Behavior

In practice, when setting the autoScrollOffset with any value, Swiper fails to execute the expected automatic scrolling of thumbnails upon activation. Instead, thumbnails switch incorrectly, not maintaining the specified offset from the edge, which leads to confusion and deteriorates the user experience when interacting with the slider. This issue is observed across various Swiper configurations and on a wide range of devices.

Swiper version

11.1.1

Platform/Target and Browser Versions

iOS, Safari

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
@SerhiiStepanenko
Copy link
Author

WFTU3831.MP4

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

1 participant