You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pagination bullets are shifting to the left when looped if dynamicBullets option is enabled. It happens even if the number of slides are smaller than the value of dynamicMainBullets parameter (see the demo). The shifted dots on the left are 'converted' to the dynamic (smaller dots) making the whole pagination look off.
From my quick investigation, something is incorrect in the offset calculation once the slides are looped over and thus rearranged. Here is the place where I suspect something is off:
Possibly, the midIndex is incorrectly calculated in the loop mode.
Expected Behavior
When looped over the pagination bullets they should not shift to any side and stay centred, just like when dynamicBullets is off:
Screen.Recording.2023-04-14.at.4.39.32.PM.mov
Actual Behavior
After the first loop is done, the dots shift to the left side, and the shifted dots are rendered as the 'dynamic' ones even though the number of slides is less than the dynamicMainPoints
Check that this is really a bug
Reproduction link
https://codepen.io/electrodrel/pen/VwEaKGE
Bug description
Pagination bullets are shifting to the left when looped if
dynamicBullets
option is enabled. It happens even if the number of slides are smaller than the value ofdynamicMainBullets
parameter (see the demo). The shifted dots on the left are 'converted' to the dynamic (smaller dots) making the whole pagination look off.From my quick investigation, something is incorrect in the offset calculation once the slides are looped over and thus rearranged. Here is the place where I suspect something is off:
swiper/src/modules/pagination/pagination.js
Lines 201 to 209 in f146726
Possibly, the
midIndex
is incorrectly calculated in the loop mode.Expected Behavior
When looped over the pagination bullets they should not shift to any side and stay centred, just like when dynamicBullets is off:
Screen.Recording.2023-04-14.at.4.39.32.PM.mov
Actual Behavior
After the first loop is done, the dots shift to the left side, and the shifted dots are rendered as the 'dynamic' ones even though the number of slides is less than the
dynamicMainPoints
Screen.Recording.2023-04-14.at.4.41.48.PM.mov
Swiper version
9
Platform/Target and Browser Versions
macOS, Chrome, Firefox
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: