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

Grid - rows > 1 + fill: 'row' + slidesPerView: 'auto' causes the swiper to go crazy #5781

Closed
5 of 6 tasks
mmanista-bynd opened this issue Jun 8, 2022 · 1 comment
Closed
5 of 6 tasks
Labels

Comments

@mmanista-bynd
Copy link

Check that this is really a bug

  • I confirm

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:
image

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

Swiper version

7.4.1 (reproduced on 8.2.2 in a codepen)

Platform/Target and Browser Versions

any

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
@nolimits4web
Copy link
Owner

Issue is closed because of outdated/irrelevant/not actual/needed more information/inactivity.

If this issue is still actual and reproducible for latest version of Swiper, please create new issue and fill the issue template correctly:

  • Clearly describe the issue including steps to reproduce when it is a bug.
  • Make sure you fill in the earliest version that you know has the issue.
  • Provide live link or JSFiddle/Codepen or website with issue

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

2 participants