Skip to content

Commit

Permalink
fix(core): fixed issue with "scroll container"
Browse files Browse the repository at this point in the history
Fixes #4161
  • Loading branch information
nolimits4web committed Jan 29, 2021
1 parent c24f7ef commit c3d0b97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/core/update/updateSlides.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ export default function updateSlides() {
snapGrid = newSlidesGrid;

if (
!swiper.params.freeMode &&
Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1
Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) >
1
) {
snapGrid.push(swiper.virtualSize - swiperSize);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,12 @@ const Pagination = {
const $el = swiper.pagination.$el;
let paginationHTML = '';
if (params.type === 'bullets') {
const numberOfBullets = swiper.params.loop
let numberOfBullets = swiper.params.loop
? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup)
: swiper.snapGrid.length;
if (swiper.params.freeMode && !swiper.params.loop && numberOfBullets > slidesLength) {
numberOfBullets = slidesLength;
}
for (let i = 0; i < numberOfBullets; i += 1) {
if (params.renderBullet) {
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
Expand Down

0 comments on commit c3d0b97

Please sign in to comment.