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

[Feature Request] - slidesPerGroup: auto #4168

Closed
AndrewBogdanovTSS opened this issue Jan 29, 2021 · 5 comments
Closed

[Feature Request] - slidesPerGroup: auto #4168

AndrewBogdanovTSS opened this issue Jan 29, 2021 · 5 comments
Projects
Milestone

Comments

@AndrewBogdanovTSS
Copy link

AndrewBogdanovTSS commented Jan 29, 2021

  • Swiper Version: 6.4.10
  • Platform/Target and Browser Versions: All

What I want to achieve:

I would like to slide per items visible on screen. When slidesPerView is set to 'auto' and each item has a fixed width there is no way to tell how many items there will be on the screen (when swiper has responsive width that is dependent on the fluid parent container) on the given moment, so it would be great if slidesPerGroup could also be set to auto so that when clicking next/prev swiper would scroll on the amount of visible items.

@nelsondude
Copy link

This would be awesome to have! Wondering if we can tell from swiper the number of slides in the current view and then you could just set that number to slidesPerGroup

@vltansky vltansky added this to the v7 milestone Jul 8, 2021
@nolimits4web nolimits4web added this to To do in v7 Jul 13, 2021
@nolimits4web nolimits4web moved this from To do to Done in v7 Aug 9, 2021
@AndrewBogdanovTSS
Copy link
Author

@nolimits4web I tried setting slidesPerGroup: 'auto' in the options using v.6.8.2 but got an error:
image
first I thought that it's related to SSR (I use Nuxt), but the error remains even if I wrap swiper inside

@AndrewBogdanovTSS
Copy link
Author

I also tried combining {slidesPerView: 'auto', slidesPerGroupAuto: true}, that didn't produce any errors, but I still have the swiper progress only for 1 item per click

@nolimits4web
Copy link
Owner

@AndrewBogdanovTSS slidesPerGroupAuto is a feature of upcoming Swiper7

@houtaro
Copy link

houtaro commented Nov 9, 2023

Hi, was this ever implemented?

slidesPerGroupAuto doesn't seem to work for me, with the same reason @AndrewBogdanovTSS mentioned. Looks like slidesPerGroup and slidesPerView: auto doesn't work when used together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v7
Done
Development

No branches or pull requests

5 participants