Skip to content

Commit

Permalink
fix(scrollbar): fix scrollbar size with centeredSlides
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 11, 2021
1 parent 34e9a1a commit 91f2f2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/scrollbar/scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export default function Scrollbar({ swiper, extendParams, on, emit }) {
$dragEl[0].style.height = '';
trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;

divider = swiper.size / swiper.virtualSize;
divider =
swiper.size / (swiper.virtualSize - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0));
if (swiper.params.scrollbar.dragSize === 'auto') {
dragSize = trackSize * divider;
} else {
Expand Down

0 comments on commit 91f2f2f

Please sign in to comment.