Skip to content

Commit

Permalink
Merge pull request #12049 from volvachev/fix-carousel-logic-for-dynam…
Browse files Browse the repository at this point in the history
…ic-values

fix(primeng/p-carousel): carousel wrong pagination, if data is loaded dynamically
  • Loading branch information
cetincakiroglu authored Nov 22, 2022
2 parents a18ba1f + 3e56ae2 commit 57656f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export class Carousel implements AfterContentInit {
}

totalDots() {
return this.value ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0;
return this.value?.length ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0;
}

totalDotsArray() {
Expand Down

0 comments on commit 57656f7

Please sign in to comment.