From 1be7b681e88a34236c529d53ff1441fe2ee65e91 Mon Sep 17 00:00:00 2001 From: KumJungMin Date: Sun, 1 Dec 2024 13:42:44 +0900 Subject: [PATCH 1/2] fix: allow autoplay when value has valid count --- packages/primevue/src/carousel/Carousel.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/primevue/src/carousel/Carousel.vue b/packages/primevue/src/carousel/Carousel.vue index 089cba713..19e6f0349 100755 --- a/packages/primevue/src/carousel/Carousel.vue +++ b/packages/primevue/src/carousel/Carousel.vue @@ -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; From a831edfee82d7604e4a7f9273d50dfe1be5741fd Mon Sep 17 00:00:00 2001 From: KumJungMin Date: Sun, 1 Dec 2024 13:49:50 +0900 Subject: [PATCH 2/2] fix: change hasValidItemCount condition --- packages/primevue/src/carousel/Carousel.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/primevue/src/carousel/Carousel.vue b/packages/primevue/src/carousel/Carousel.vue index 19e6f0349..482579b68 100755 --- a/packages/primevue/src/carousel/Carousel.vue +++ b/packages/primevue/src/carousel/Carousel.vue @@ -602,7 +602,7 @@ export default { return this.orientation === 'vertical'; }, hasValidItemCount() { - return this.value && this.value.length >= this.d_numVisible; + return this.value && this.value.length > this.d_numVisible; }, isCircular() { return this.hasValidItemCount() && this.d_circular;