Closed maheshambiga closed 7 years ago
It works for me.
How are you passing the prop? Note that if you pass anything other than the boolean value false
, it will be treated as true, including "false", null, and undefined. Can you use React devtools to make sure it's getting passed through as you expect?
Actually, the problem is that onTouchMove doesn't check to see if dragging is enabled.
Oh, I see. It does disable mouse swipe/dragging, but doesn't disable touch swipe/dragging.
So does everyone think there should be a swiping
prop to disable swiping?
I think so. My use case was that users could only move in one direction, and only through button click. I was using it like a sales squeeze page. So it would have been great to be able to turn swipe off.
Mike
On Thu, Jul 7, 2016 at 10:44 AM, Ken Wheeler notifications@github.com wrote:
So does everyone think there should be a swiping prop to disable swiping?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kenwheeler/nuka-carousel/issues/106#issuecomment-231099351, or mute the thread https://github.com/notifications/unsubscribe/AAJLoilajMU7hquGuG5BpI1iLhEG6aUsks5qTRDQgaJpZM4I7jh1 .
Here, {dragging:false} should disable touchMove as well. It does not make any sense have a separate prop to restrict swipe. Dragging is nothing but mouse drag as well as touchMove.
https://github.com/FormidableLabs/nuka-carousel/blob/master/lib/carousel.js#L221
adding if (this.props.dragging === false) { return null; }
in /lib/carousel.js line 221 will work. I hope to see a solution on the next release.
There should be a swiping prop to disable swiping. +1
Passing prop {dragging:false} is not preventing dragging of slides on swipe.