brainhubeu / react-carousel

A pure extendable React carousel, powered by Brainhub (craftsmen who ❤️ JS)
https://brainhub.eu/
MIT License
1.07k stars 164 forks source link

clickToChange does not work when using without slidesPerPage #513

Open viniciuscr opened 4 years ago

viniciuscr commented 4 years ago

Describe the bug I am not sure if this is actually a bug or limitation, but clickToChange only works when slidesPerPage is bigger than 1.

To Reproduce

<Carousel clickToChange >
  <div>Slide 1</div>
  <div>Slide 2</div>
  <div>Slide 3</div>
</Carousel>

Expected behavior Same as the docs, but with only 1 slide been displayed https://brainhubeu.github.io/react-carousel/docs/examples/clickToChange

Environment System: OS: macOS 10.15.5 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Memory: 186.60 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.13.1 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.12.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Browsers: Chrome: 83.0.4103.61 Safari: 13.1.1 npmPackages: @brainhubeu/react-carousel: ^1.16.0 => 1.17.0

piotr-s-brainhub commented 4 years ago

@viniciuscr

Thanks for reporting this. In your opinion, how should it work?

Should the neighboring items be partially visible, allowing clicking them?

viniciuscr commented 4 years ago

Hi @piotr-s-brainhub, In my case I want to switch between with and without arrows, for desktop and mobile respectively. My expectation was to have some div over the slide behaving as as arrow. autodraw 6_4_2020 the blue rectangle would be my slide the orange ones are clickable areas working as left and right arrow

this would be a great improve in mobile screens, cause arrows takes a good portion of space

piotr-s-brainhub commented 4 years ago

@viniciuscr

Thanks so IMO it's a feature request.

You're more than welcome to open a PR to implement that.

Or you can invite your colleagues to like (👍) this issue so more 👍 it has, it's more likely to be implemented by us in the nearest future.