fix(carousel): out of order slides when inside sl-resize-observer (#2260)

* fix: sync slides after complete initialization

* chore: leftover
This commit is contained in:
Alessandro
2024-11-12 17:07:05 +01:00
committed by GitHub
parent 3178dc6278
commit 51473c608e

View File

@@ -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() {