diff --git a/src/core/components/swipe-slides/swipe-slides.html b/src/core/components/swipe-slides/swipe-slides.html index d3b02b245..bcfc05ac8 100644 --- a/src/core/components/swipe-slides/swipe-slides.html +++ b/src/core/components/swipe-slides/swipe-slides.html @@ -1,5 +1,4 @@ - + diff --git a/src/core/components/swipe-slides/swipe-slides.ts b/src/core/components/swipe-slides/swipe-slides.ts index a2569739e..f063ffd72 100644 --- a/src/core/components/swipe-slides/swipe-slides.ts +++ b/src/core/components/swipe-slides/swipe-slides.ts @@ -50,6 +50,13 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe if (swiperRef?.nativeElement?.swiper) { this.swiper = swiperRef.nativeElement.swiper as Swiper; + if (this.options.initialSlide) { + this.swiper.slideTo(this.options.initialSlide, 0, this.options.runCallbacksOnInit); + } + + this.swiper.on('slideChangeTransitionStart', () => this.slideWillChange()); + this.swiper.on('slideChangeTransitionEnd', () => this.slideDidChange()); + Object.keys(this.options).forEach((key) => { if (this.swiper) { this.swiper.params[key] = this.options[key];