From 30b61cb605fc828c17c6f9c797db5d7cd790287e Mon Sep 17 00:00:00 2001 From: nishant203 Date: Sat, 3 Apr 2021 23:25:41 +0530 Subject: [PATCH] Fixed - Carousel Bug #10051 Assigning new reference to prevState.value when new item is added to value array --- src/app/components/carousel/carousel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/carousel/carousel.ts b/src/app/components/carousel/carousel.ts index 1ded262d090..cb1e91fbe76 100755 --- a/src/app/components/carousel/carousel.ts +++ b/src/app/components/carousel/carousel.ts @@ -304,7 +304,7 @@ export class Carousel implements AfterContentInit { this._oldNumScroll = this._numScroll; this.prevState.numScroll = this._numScroll; this.prevState.numVisible = this._numVisible; - this.prevState.value = this._value; + this.prevState.value = [...this._value]; if (this.totalDots() > 0 && this.itemsContainer.nativeElement) { this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100/ this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100/ this._numVisible)}%, 0, 0)`;