Skip to content

Commit

Permalink
Merge pull request #6902 from KumJungMin/fix/issue-6812
Browse files Browse the repository at this point in the history
fix(Carousel): allow autoplay when value has valid count
  • Loading branch information
tugcekucukoglu authored Dec 2, 2024
2 parents 0eec496 + a831edf commit cd1e762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/primevue/src/carousel/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,14 @@ export default {
isVertical() {
return this.orientation === 'vertical';
},
hasValidItemCount() {
return this.value && this.value.length > this.d_numVisible;
},
isCircular() {
return this.value && this.d_circular && this.value.length >= this.d_numVisible;
return this.hasValidItemCount() && this.d_circular;
},
isAutoplay() {
return this.autoplayInterval && this.allowAutoplay;
return this.hasValidItemCount() && this.autoplayInterval && this.allowAutoplay;
},
firstIndex() {
return this.isCircular() ? -1 * (this.totalShiftedItems + this.d_numVisible) : this.totalShiftedItems * -1;
Expand Down

0 comments on commit cd1e762

Please sign in to comment.