You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to do a 2-row Swiper with slidesPerView: 'auto' and a grid setup, so it looks a bit like a very basic Masonry layout:
With the following setup, Swiper goes crazy and does not seem to have a consistent number of rows, even though I've specified them to be 2. As a rough example, in my case, for 25 items it collapses into 3 rows (and is not horizontally swipe-able - the width of .swiper-wrapper is not calculated properly), but for 100 items it stays in 2 rows, which kind of works.
Expected Behavior
.swiper-wrapper's width is calculated properly, the items stay in 2 rows (or whatever is specified in grid.rows parameter)
Actual Behavior
.swiper-wrapper's width is not calculated properly (it's less than 100% of the container's width), the items are wrapping into a new line too early, which makes them go into more rows than specified in grid.rows param
Check that this is really a bug
Reproduction link
https://codesandbox.io/s/swiper-slides-grid-react-forked-5brvjl?file=/src/App.jsx
Bug description
I am trying to do a 2-row Swiper with

slidesPerView: 'auto'
and a grid setup, so it looks a bit like a very basic Masonry layout:With the following setup, Swiper goes crazy and does not seem to have a consistent number of rows, even though I've specified them to be 2. As a rough example, in my case, for 25 items it collapses into 3 rows (and is not horizontally swipe-able - the width of
.swiper-wrapper
is not calculated properly), but for 100 items it stays in 2 rows, which kind of works.Expected Behavior
.swiper-wrapper
's width is calculated properly, the items stay in 2 rows (or whatever is specified ingrid.rows
parameter)Actual Behavior
.swiper-wrapper
's width is not calculated properly (it's less than 100% of the container's width), the items are wrapping into a new line too early, which makes them go into more rows than specified ingrid.rows
paramSwiper version
7.4.1 (reproduced on 8.2.2 in a codepen)
Platform/Target and Browser Versions
any
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: