nuka-carousel icon indicating copy to clipboard operation
nuka-carousel copied to clipboard

Cannot manually set the slide width in v5

Open andrewdowis opened this issue 2 years ago • 3 comments

Looking up the documentation on v4, I came across this CodeSandBox and played around with controls to see how it handled compared to v5. I like it better.

What I want to do in v5 is this:

image

three large slides but not fit into the container such that the middle slide is in full view and the outer two are cropped. v3 did this, v4 did this. v5 seems to brag about removing this useful feature.

I would like slideWidth or initialSlideWidth to be added back in as overrides.

Describe Your Environment

  • What version of nuka-carousel are you using? 5.2.0
  • What version of React are you using? 16.12.0 requiing an upgrade to @17, which nuka-carousel@3 conflicts with
  • What browser are you using? MacOS Desktop Chrome Version 109.0.5414.119

Describe the Problem

All slides are equally fit into the Carousel rather than being the size I dictate

andrewdowis avatar Jan 27 '23 00:01 andrewdowis

This is fixed in the latest release https://github.com/FormidableLabs/nuka-carousel/commit/84ee1252bba7268c58ab48f4037d6ec5a3b1f55d

allypalanzi avatar Mar 14 '23 19:03 allypalanzi

Great news!

andrewdowis avatar Mar 14 '23 20:03 andrewdowis

Can someone provide an example of how to accomplish OP's example? Is there a way to set the slideWidth only on the active slide and have the other's adjust?

alxvallejo avatar Apr 03 '23 18:04 alxvallejo

Slidewidth is entirely controlled by the consumer now in v8, with support for multiple slide widths.

carbonrobot avatar Apr 05 '24 18:04 carbonrobot