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.

The last item in the pagination never becomes "active" in some situations.

See original GitHub issue

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Swiper Version: swiper@4.3.3

  • Platform/Target and Browser Versions: macOS High Sierra 10.13.6 (Safari browser Version 12.0 (13606.2.11) ).

What you did

Swiper was created with following parameters:

var swiper = new Swiper('.slider-container', {
      speed: 1000,
      slidesPerView: 'auto',
      spaceBetween: 30,
      slidesOffsetAfter: 300,
      visibilityFullFit: true,
      autoResize: true,
      pagination: {
        clickable: true,
        el: '.slider-pagination',
        type: 'bullets'
      },
      breakpoints: {
        1200: {
          slidesOffsetAfter: 100
        }
      }
    });

Two slides in view are shown and third slide is only partially visible at right side of the screen with opacity set to 0.5. There are many slides that are out of the bounds of the right side of the screen.

Expected Behavior

When swiping to last element last (and last-1) element is not being set as active.

For example this is the last scrolled slide, but DOM looks like this:

Image

Actual Behavior

When user scrolls to last slide, last slide should be active.

Same issue as described here: #391

It was closed, but looks like issue still exists. Last element never gets active state.

This limits the styling of gallery (for example if it is required that next element that is out of the screen should be transparent).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

4reactions
stale[bot]commented, Nov 29, 2019

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

4reactions
stale[bot]commented, Sep 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The last item in the pagination never becomes "active ... - GitHub
The last item in the pagination never becomes "active" when the slides are not full width of Swiper's viewport and at least half...
Read more >
The End of Pagination - Coding Horror
Once you have thousands of items, you don't have a pagination problem. You have a search and filtering problem.
Read more >
Understanding pagination: REST, GraphQL, and Relay
This can happen if a new item was added at the top of the list, causing the skip and limit approach to show...
Read more >
The best database pagination technique is … | by Matej Bačo
Cursor pagination solves this by using the index of the last row you fetched and it knows exactly where to start looking from,...
Read more >
Avoid the Pains of Pagination - UX Movement
However, if your pagination has only a few pages in the low double digits or below, showing the pages in your pagination can...
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