From 51473c608efdcd639613e553dd7dd8f842bb2181 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Tue, 12 Nov 2024 17:07:05 +0100 Subject: [PATCH] fix(carousel): out of order slides when inside sl-resize-observer (#2260) * fix: sync slides after complete initialization * chore: leftover --- src/components/carousel/carousel.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/carousel/carousel.component.ts b/src/components/carousel/carousel.component.ts index c9883fa34..55cbbc1aa 100644 --- a/src/components/carousel/carousel.component.ts +++ b/src/components/carousel/carousel.component.ts @@ -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() {