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

why keepDirectionWhenDragging and minDraggableOffset can't valid at the same time? #539

Closed zhengkaidi closed 4 years ago

zhengkaidi commented 4 years ago

As the title says,i add minDraggableOffset at Draggable examples in doc(https://brainhubeu.github.io/react-carousel/docs/examples/draggable). And i want to know it's a bug or feature?

piotr-s-brainhub commented 4 years ago

@zhengkaidi

Thanks for this question.

I just checked minDraggableOffset works neither on desktop nor on mobile (even minDraggableOffset={0} or minDraggableOffset={1} requires a large offset to change the slide).

As I remember, minDraggableOffset was introduced in order to work around an issue but I don't remember which one.

zhengkaidi commented 4 years ago

Thanks for your answer , it seems that I understand minDraggableOffset wrongly. But now I have another question. After setting keepDirectionWhenDragging on a mobile page ,it is now so sensitive that it slides to next item even if my finger moves a small distance. Do you have any suggestion to help me ? @piotr-s-brainhub

piotr-s-brainhub commented 4 years ago

@zhengkaidi

I created an issue for that: https://github.com/brainhubeu/react-carousel/issues/540. You can like (👍) this issue and invite your friends to like it, so more 👍 it has, it's more likely to be fixed by us.

You're also more than welcome to open a PR, fixing it.

RobertHebel commented 4 years ago

@piotr-s-brainhub @zhengkaidi As readme says

Defines the minimum offset to consider the drag gesture

This prop prevents accidental clicks when the carousel has links as slides.

More details here: https://github.com/brainhubeu/react-carousel/issues/131