Skip to content

Commit

Permalink
fix(primeng/p-carousel): carousel wrong pagination, if data is loaded…
Browse files Browse the repository at this point in the history
… dynamically

Fixes #12043.
  • Loading branch information
volvachev authored and Egor Volvachev committed Nov 15, 2022
1 parent 6327328 commit 3e56ae2
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 3e56ae2

Please sign in to comment.