-
Notifications
You must be signed in to change notification settings - Fork 121
Touch Events Not Working #54
Comments
http://plnkr.co/edit/HNusw03NPBOxg4hDgh50 Edit: Of course, view this either in Chome emulator or on your phone... |
Please, could anyone else at least test this quickly to let me know this isn't just a problem with how I'm using it..? |
I have the same problem, the slider is not responding to touch events. I hope this will be fixed soon because this slider works quite good on desktop with mouse. |
Try adding the extra condition " || event.touches[0].clientX; " to the following lines:
For me, this fixes the complete functionality loss but throws an error in the console (due to me not checking everything completely I'm sure). Its not a showstopping error so I haven't devoted any more of my own time to it... yet. Was hoping this guy actually maintained his projects. |
Tnx, I just added this but instead used event.changedTouches[0].clientX can't see any errors. Strange that this fix is needed though, since the events should be coming from $swipe which should have an x value |
Thank you so much for your response! Seems as though I was just pointing to the incorrect event. |
+1 to @dasblitz's fix. I had wanted to include this slider in my project for months, and ended up going with a far inferior html-5 range input. I'm not experienced enough with touch events to have debugged this issue myself, so many thanks. |
It's also important to note that if your project uses jQuery, jQuery appears to wrap touch events, so instead of |
kinda new to this, @dasblitz note about event.originalEvent.changedTouches[0].clientX return the right position of the touch event, the errors where thrown on "touchend" event which has no touches, i solved this by removing the calles to OnMove inside bindSwipe function Line 1755 and bindSlider Line 1685, |
Seems there is an issue with pulling 'clientX' from the captured events. I believe event.touches[0].clientX is not being captured, or not being accounted for properly.
Please see OnMove (Line 1419) and OnStart (Line 1623) functions.
(Angular-slider.js --Version 0.3.2)
If I add " || event.touches[0].clientX; " to that line, the sliding works, but throws an error (probably just needs some additional checks)
Has anyone else experienced this issue? Or hopefully I just overlooked something simple.. I'll try to throw a punkr together this evening.
The text was updated successfully, but these errors were encountered: