FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
2.99k stars 594 forks source link

Carousel does not work with varying width slides #1042

Closed vzsoares closed 2 months ago

vzsoares commented 5 months ago

Bugs and Questions

Describe Your Environment

Describe the Problem

Carousel does not work with varying width slides, it can't navigate properly:

issue

it increases the current slide but it doesn't show it

Expected behavior:

It should work properly (:

Actual behavior

It can't navigate properly

Additional Information

I saw the code, and it assumes the width will be the same; so this might be a big change; The offset calculations should probably find the boundingRect of the slide child nodes and use that for reference

important prop is slideWidth="auto" and the varying size images

codesandbox

carbonrobot commented 2 months ago

Released in v8