react-component / slider

React Slider
https://slider.react-component.now.sh/
MIT License
3.04k stars 767 forks source link

Slider reacting to wrong gesture on touch devices #308

Open nealoke opened 7 years ago

nealoke commented 7 years ago

First of all thank you for this over the moon great component 🔥

My issue is relevant on touch screens and I'm not sure if it is a problem of the component itself but I would love some suggestions / fixes for this issue.

My slider is horizontal and I have a few rendered below each other. When trying to navigate up and down the page and accedently touching a slider it also moves and thus blocks my navigation.

The ideal solution I can think of is a prop that could turn off this behaviour like interactHorizontal and interactVertical.

Example of the issue navigation issue

paranoidjk commented 7 years ago

Yep, right now we do not lock gesture direction.

PR is welcome.

nealoke commented 7 years ago

@paranoidjk is this possible at all? :) Just wondering how I could help, but honestly I would have no idea on how to to such a thing 😨

paranoidjk commented 7 years ago

https://github.com/react-component/slider/blob/master/src/common/createSlider.jsx#L169

@nealoke calculate gesture move direction in touchmove, eg: https://github.com/react-component/gesture/blob/master/src/index.tsx#L341

nealoke commented 7 years ago

So it is already available in this component? or am I missing something? :)

DieterHolvoet commented 6 years ago

Any progress on this issue?

nealoke commented 6 years ago

@DieterHolvoet I did not fix this as I am lacking time :(

DieterHolvoet commented 6 years ago

Chances are I'll get some time at work to fix this issue during the coming week, I'll keep you posted.

Idicious commented 6 years ago

Having the same issue with horizontal scrolling + vertical sliders.

DieterHolvoet commented 6 years ago

I already fixed this, just need to take the time to test some more and make a pull request

gyzerok commented 5 years ago

Hello everyone!

The issue with the slider and touch screen seem to still exist. Are there any updates on the solution? Is there a workaround for it?