Pagination from default to dynamic is not refreshing correctly on breakpoint
See original GitHub issueThis is a:
-
bug
-
Swiper Version: 4.5.0
-
Platform/Target and Browser Versions: All
-
Code:
var swiper_settings = {
slidesPerView: 4,
slidesPerGroup: 4,
spaceBetween: 40,
loop: false,
speed: 500,
simulateTouch: false,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
},
breakpoints: {
540: {
slidesPerView: 1,
slidesPerGroup: 1,
spaceBetween: 30,
pagination: {
dynamicBullets: true,
dynamicMainBullets: 8,
clickable: false,
}
},
640: {
slidesPerView: 2,
slidesPerGroup: 2,
spaceBetween: 30,
pagination: {
dynamicBullets: true,
dynamicMainBullets: 8,
}
},
768: {
slidesPerView: 2,
slidesPerGroup: 2,
spaceBetween: 40,
pagination: {
dynamicBullets: false,
}
},
900: {
slidesPerView: 3,
slidesPerGroup: 3,
spaceBetween: 30,
pagination: {
dynamicBullets: false,
}
},
1024: {
slidesPerView: 3,
slidesPerGroup: 3,
spaceBetween: 40,
pagination: {
dynamicBullets: false,
}
},
1280: {
slidesPerView: 4,
slidesPerGroup: 4,
spaceBetween: 30,
pagination: {
dynamicBullets: false,
}
}
}
}
var mySwiper = new Swiper('.swiper-container', swiper_settings);
What you did
I’ve tried various functions available like mySwiper.destroy(), then setting a new instance, mySwiper.update, both on resize/orientation change event, but neither of these are working.
Expected Behavior
When you hit breakpoints 540 or 640 on window resize (on mobile devices orientation changes also) the pagination should “refresh”, then get correct positioning, style and number of bullets should apply from default pagination to dynamic and vice versa.
Actual Behavior


Pagination is keeping the settings/styles from previous breakpoint and aren’t dynamic and same situation if you resize from small to bigger. Pagination is correct when you refresh browser, but that is not correct behavior.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Swiper slider not working unless page is resized
Swiper's sliders, in order to work properly, requires you to either: Initialize them when they are visible; Update them when they get ...
Read more >Control pagination
On the Format menu, click Paragraph, and then click the Line and Page Breaks tab. Select the Page break before check box. Control...
Read more >Spring Data JPA Tutorial: Pagination
This blog post describes how you can paginate your query results with Spring Data JPA.
Read more >Angular Change Detection - How Does It Really Work?
By default, Angular Change Detection works by checking if the value of template expressions have changed. This is done for all components. We ......
Read more >Table
The default table displays your data in simple rows and is responsive, it breaks into mobile layout on Breakpoint.Xs unless changed.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a solution
breakpoints: { 320: { slidesPerView: 1, slidesPerGroup: 1, pagination: { dynamicBullets: true, dynamicMainBullets: 7, }, }, 430: { slidesPerView: 2, slidesPerGroup: 2, pagination: { dynamicBullets: false, }, }, }, on: { breakpoint: function (swiper) { if (swiper.params.pagination.dynamicBullets) { swiper.pagination.init() } else { setTimeout(function () { swiper.pagination.el.style.width = ‘100%’ swiper.pagination.el.classList.remove(‘swiper-pagination-bullets-dynamic’) }) } }, }
there is a solution problemy? I’m seeing the same issue.
samle codepen https://codepen.io/smartfox87/pen/yLewmJK
Video Sample https://take.ms/2Qv3f