question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slide order with column layout and > 3 slides per column wrong

See original GitHub issue

This is a:

What you did

Set up a slider instance using slidesPerView: 2, slidesPerColumn: 4 and slidesPerGroup: 2, therefore a slider with two columns having 4 entries each.

Expected Behavior

Two columns, 4 slides each, in ascending order. E.g. 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16

See: https://codepen.io/sosterwalder/pen/LgbeLw.

Actual Behavior

Orderding is not correct, see https://codepen.io/sosterwalder/pen/PybEgK:

1 5 9 13 2 6 10 14 3 7 11 15 8 12 16 20

It seems that the bottom row seems to have an offset, is not in correct order. This happens only when using more than 6 slides per “page” (8 in my case).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
JLuekecommented, May 9, 2019

While testing I noticed the main problem for my setup slidesPerColumn: 4 is not the order but the filling of the rows: 12 items where placed as expected. 10 items failed for the 2nd and 3rd page. They only showed 3 items each. Expected would be 1. page 4 items, 2. page 4 items, 3. page 2 item.

My workaround is using grid for display instead of flex and resetting the order:

CSS:

.swiper-wrapper {
  display: grid;
  grid-template-columns: 1fr; // based on slidesPerView
  grid-template-rows: auto auto auto auto; // based on slidesPerColumn
  grid-auto-flow: column;
}

JS:

// run after init and update of swiper
$('selector-for-the-swiper-wrapper').find('.swiper-slide').each(function (i) {
  $(this).css({'order': i, '-webkit-box-ordinal-group': i});
});
0reactions
stale[bot]commented, Jan 4, 2020

This issue has been automatically closed due to inactivity. If this issue is still actual, please, create the new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swiper JS slides per view and slides per column displaying ...
It seems that the setting slidesPerColumn does not work. Then I was checking which CSS comes from the swiper css with those Swiper...
Read more >
Apply a slide layout
Simplify the task of arranging information on your slide by applying a pre-defined "layout."
Read more >
Reordering Your Slides - Microsoft PowerPoint
Go to the View Ribbon and click on the Slide Sorter icon (or click on the icon in the Status Bar). This view...
Read more >
7.3 Slide formatting | R Markdown: The Definitive Guide
.left-column[ ] and .right-column[ ] provide a sidebar layout. The left sidebar is narrow (20% of the ...
Read more >
Requests | Google Slides
Layout reference of the slide to be inserted, based on the current master , which is one of ... If this is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found