-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dragging the slider on iOS #139
base: master
Are you sure you want to change the base?
Conversation
I've been having this problem for a while and this fix LGTM 👍 |
Ping @davidchin 🙂 |
I need this too! |
Thx for fixing! |
👏 please merge @davidchin |
I've published a fork in the meantime in case someone needs an urgent fix: react-input-range-ios-fix |
@amannn Thanks for this. Just gave your package a try. I still seem to be missing dragging on my iphone 8+ UPDATE: I thought this fix was for for dragging the entire track (i.e. draggableTrack=true). I didn't realize you meant dragging the min/max handles. It seems draggableTrack isn't possible in iOS |
Ah, yes that's correct. I've seen that the component has a |
Thanks for the fix! @davidchin could you merge this PR? |
Ping @davidchin |
Hey @davidchin, sorry for bothering you again. Would be really helpful if you could have a look at this / merge it, as other people seem to experience the issue as well. |
In Safari on iOS I noticed that dragging the slider doesn't work, if the finger is moved along the track. This doesn't practically happen in your demos, as the track is very tiny, but if you increase the size for better touch support, you'll see this issue. Another issue is, that while dragging the slider, the page will scroll with the finger.
react-input-range-ios.mov
A call to
preventDefault()
in thetouchstart
handler fixes this issue. However, React attaches the event handler aspassive
and currently doesn't offer an API for opting into active mode. Therefore we need to handle the handler registration ourselves.Now everything works as expected:
react-input-range-fixed.mov
Would be great if we could get this merged and released in the near future 🙂