Skip to content

Commit 33be36d

Browse files
rossholdwaymanucorporat
authored andcommitted
fix(slides): negative number indicates position starting at end (#10997)
* fix(slides): negative number indicates position starting at end * refactor(slides): use var instead of let
1 parent a055457 commit 33be36d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/slides/swiper/swiper-pagination.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ export function updatePaginationClasses(s: Slides) {
6363

6464
// Types
6565
if (s.paginationType === 'bullets' && s._bullets) {
66+
var selector = current + ( current < 0 ? s._bullets.length : 0 );
6667
for (var i = 0; i < s._bullets.length; i++) {
67-
if (i === current) {
68+
if (i === selector) {
6869
addClass(s._bullets[i], CLS.bulletActive);
6970
} else {
7071
removeClass(s._bullets[i], CLS.bulletActive);

0 commit comments

Comments
 (0)