primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.84k stars 1.24k forks source link

Carousel: Item disappear when there is only one item with autoplay and circular activated #6812

Open Allenille opened 6 days ago

Allenille commented 6 days ago

Describe the bug

Carousel: Item disappear when there is only one item with autoplay and circular activated

Reproducer

https://stackblitz.com/edit/evvfnc?file=src%2FApp.vue

PrimeVue version

4.2.2

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

To reproduce you can take the circular example from here : https://primevue.org/carousel/#circular Open it in stackblitz and instead of having 9 elements in your list just remove the ither to have only one element to show. Capture d’écran 2024-11-19 111356

Expected behavior

Element should appear and not disappear

sivareddyuppathi commented 6 days ago

Hi @Allenille , if you pass :numVisible="1" if you have only one element it will work as expected. Let me know if it is not.

` <Carousel :value="products" :numVisible="1" :numScroll="1" :responsiveOptions="responsiveOptions" circular :autoplayInterval="3000"

`

D4RKAR117 commented 6 days ago

Hey i also had the issue, and i narrowed the issue that is only present when the circular prop is true even without autoplay, temporal workaround is to simply put it false (or remove it)

also somehow if the content is visible outside (like a component with a fixed prop) of the carousel works just fine even with circular prop

Allenille commented 5 days ago

Hi @sivareddyuppathi , still have the issue with :numVisible="1" : https://stackblitz.com/edit/evvfnc-vyqemd?file=src%2FApp.vue As @D4RKAR117 mentioned if I remove the circular prop everything is working fine. To resolve this I just deactivate circular props when there is less element than the number of element visible but I think that this problem should be handled by the caroussel itself no ?