Skip to content

Commit

Permalink
fix(element): don't render swiper on every connected
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Apr 24, 2023
1 parent e4f3def commit 5a5ebb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/element/swiper-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class SwiperContainer extends ClassToExtend {
}

render() {
if (this.rendered) return;
if (globalInjectStyles) {
// global styles
addGlobalStyles(false, this);
Expand Down Expand Up @@ -103,6 +104,7 @@ class SwiperContainer extends ClassToExtend {
[...this.tempDiv.children].forEach((el) => {
this.shadowEl.appendChild(el);
});
this.rendered = true;
}

initialize() {
Expand Down

0 comments on commit 5a5ebb4

Please sign in to comment.