Swiper: Flexbox stretch properties stop working when swiper applied

Created on 8 Feb 2017  路  3Comments  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)
  • Swiper Version: 3.4.1
  • Platform/Target and Browser Versions: Tested on macOS 10.12.3, iOS 9/10, Safari 10.0.3, Chrome 56

What you did

I used flexbox to create a equal-height grid of 'cards'.
I added swiper as instructed in the docs.

Expected Behaviour

When swiper is applied the flex layout should stay the same.

Actual Behaviour

The cards no longer 'stretch' to be equal heights.

See here for reduced test case.. http://thehooknew.webflow.io/swiper-test
The grid of cards at the top has display: flex applied to the container .flex-parent and the cards behave as expected, stretching to have equal heights. The grid below is the same but with swiper classes, styles and scripts applied 鈥撀爊otice how the cards are no longer equal height (the first grid is the same as the second but with swiper classes removed from the elements).

I can find one person with the same problem in the forum but no solution.

(Many thanks for the script and any help).

Most helpful comment

This question is about CSS and how flexbox works in general. Just add this to CSS:
```
.swiper-slide {
height: auto;
}

All 3 comments

This question is about CSS and how flexbox works in general. Just add this to CSS:
```
.swiper-slide {
height: auto;
}

So simple in the end, thanks!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cristianfierro picture cristianfierro  路  4Comments

nicolebo picture nicolebo  路  3Comments

Joshanity17 picture Joshanity17  路  3Comments

aeblin picture aeblin  路  3Comments

callumacrae picture callumacrae  路  3Comments