Skip to content

Commit 12909d0

Browse files
authored
Merge branch 'master' into some-lint-fixes
2 parents 6b2855c + a0777f4 commit 12909d0

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,16 +1112,18 @@ export class IgxCarouselComponent implements OnDestroy, AfterContentInit {
11121112
}
11131113

11141114
private updateSlidesSelection() {
1115-
requestAnimationFrame(() => {
1116-
if (this.currentSlide) {
1117-
this.currentSlide.active = true;
1118-
const activeSlides = this.slides.filter(slide => slide.active && slide.index !== this.currentSlide.index);
1119-
activeSlides.forEach(slide => slide.active = false);
1120-
} else if (this.total) {
1121-
this.slides.first.active = true;
1122-
}
1123-
this.play();
1124-
});
1115+
if (this.platformUtil.isBrowser) {
1116+
requestAnimationFrame(() => {
1117+
if (this.currentSlide) {
1118+
this.currentSlide.active = true;
1119+
const activeSlides = this.slides.filter(slide => slide.active && slide.index !== this.currentSlide.index);
1120+
activeSlides.forEach(slide => slide.active = false);
1121+
} else if (this.total) {
1122+
this.slides.first.active = true;
1123+
}
1124+
this.play();
1125+
});
1126+
}
11251127
}
11261128
}
11271129

0 commit comments

Comments
 (0)