Skip to content

Commit

Permalink
fix(element): remove infinite preloader in loop (#7886)
Browse files Browse the repository at this point in the history
* style: remove blank line

* fix: check swiperLoopMoveDOM on rerender element

---------

Co-authored-by: Eduardo Battisti <eduadobattisti@pop-os.localdomain>
  • Loading branch information
eduardobattisti and Eduardo Battisti authored Feb 12, 2025
1 parent 0b688a1 commit c0d3ece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/core/loop/loopFix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export default function loopFix({
if (isPrev) {
prependSlidesIndexes.forEach((index) => {
slides[index].swiperLoopMoveDOM = true;

slidesEl.prepend(slides[index]);
slides[index].swiperLoopMoveDOM = false;
});
Expand Down
4 changes: 4 additions & 0 deletions src/swiper-element.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ class SwiperSlide extends ClassToExtend {
}

connectedCallback() {
if (this.swiperLoopMoveDOM) {
return;
}

this.initialize();
}
}
Expand Down

0 comments on commit c0d3ece

Please sign in to comment.