Skip to content

Commit

Permalink
fix(carousel): out of order slides when inside sl-resize-observer (#2260
Browse files Browse the repository at this point in the history
)

* fix: sync slides after complete initialization

* chore: leftover
  • Loading branch information
alenaksu authored Nov 12, 2024
1 parent 3178dc6 commit 51473c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ export default class SlCarousel extends ShoelaceElement {
this.createClones();
}

this.synchronizeSlides();

// Because the DOM may be changed, restore the scroll position to the active slide
this.goToSlide(this.activeSlide, 'auto');

this.synchronizeSlides();
}

private createClones() {
Expand Down

0 comments on commit 51473c6

Please sign in to comment.