nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions

Home Page:https://swiperjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slidesPerView: "auto" doesn't work property (slidesPerView: "auto" == slidesPerView: 1)

pablo-miralles opened this issue · comments

Check that this is really a bug

  • I confirm

Reproduction link

https://codepen.io/pablomiralles/pen/abrNoxd

Bug description

As the title says, slidesPerView auto doesn't do anything by default, it's the same that using slidesPerView 1.

Expected Behavior

I think the expected behaviour should be the same as what happens when you add .swiper-slide {width: auto} in my example, not being 100% by default.

It works perfect because when it's not slidesPerView auto, the .swiper-slide width is an inline JS style, so the specificity is higher.

Actual Behavior

The actual behaviour is giving swiper-slide element a width: 100%

Swiper version

11.1.3

Platform/Target and Browser Versions

All

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

You must set slide's sizes in CSS