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

Weird dragging behaviour if value for slidesPerGroup is a string #6968

Closed
3 of 4 tasks
warudin opened this issue Aug 23, 2023 · 2 comments
Closed
3 of 4 tasks

Weird dragging behaviour if value for slidesPerGroup is a string #6968

warudin opened this issue Aug 23, 2023 · 2 comments

Comments

@warudin
Copy link

warudin commented Aug 23, 2023

Clear and concise description of the problem

If the value for slidesPerGroup for whatever reason is a string instead of an integer, the slider becomes somewhat unusable.

See the following example: https://codesandbox.io/p/sandbox/swiper-pagination-forked-hv54q2?file=/index.html:78,27

If you try to drag beyond the second "group" (slides 3-4), the slider will return to the second group. Using the bullets to go to the third group will also produce weird behaviour, when trying to drag further.

Interestingly, the same behaviour is not happening when the value for slidesPerView is a string. So slidesPerView is a bit more robust already?

Suggested solution

Apply the same king of sanitising on slidesPerGroup as is applied on slidesPerView

Alternative

No response

Additional context

No response

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.

Would you like to open a PR for this feature?

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

Docs clearly says It must be a number https://swiperjs.com/swiper-api#param-slidesPerGroup

@warudin
Copy link
Author

warudin commented Aug 24, 2023

Fair enough, why not make Swiper more robust though? 🤷‍♂️

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

No branches or pull requests

2 participants