themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.29k stars 708 forks source link

Carousel still buggy with 2 items on version 2.3.0 #886

Open FedericoDeBona opened 1 month ago

FedericoDeBona commented 1 month ago

Describe the bug If you create a carousel containing only 2 Images, the Animation when sliding, does not looks right

To Reproduce Using the 2.3.0 version from jsDelivr, in this example the bug is clear: codepen

Expected behavior Even if there are only two Items in the Carousel I expect to have the right animations.

Desktop (please complete the following information):

Lexachoc commented 1 month ago

I think the carousel component's logic should be rewritten. The source code considers 3 conditions/items (left, middle, right), and translate -100% (the last item) and 100%(the second item) for left and right item.

Therefore, the visual look for navigating between 2 items is strange.

FedericoDeBona commented 4 weeks ago

Do you happen to know if will be fixed in the near future?

zoltanszogyenyi commented 4 weeks ago

We're looking into it, but anyone is more than welcome to create a PR for this one. I'll check it. Thanks!