Skip to content
Permalink
Browse files

Prevent scrolling when swipe up/down is detected

  • Loading branch information
madrobby committed Mar 2, 2013
1 parent ed7b86c commit d945672b89be7957b268e01df1dc6425de5932b1
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/touch.js
@@ -57,6 +57,8 @@
cancelLongTap()
touch.x2 = e.touches[0].pageX
touch.y2 = e.touches[0].pageY
if (Math.abs(touch.x1 - touch.x2) > 10)
e.preventDefault()
})
.bind('touchend', function(e){
cancelLongTap()

5 comments on commit d945672

@wolfv

This comment has been minimized.

Copy link

@wolfv wolfv replied May 14, 2013

this breakes scrolling on a list where tap events are attached

@miniatureape

This comment has been minimized.

Copy link

@miniatureape miniatureape replied May 23, 2013

Yeah, I'm with @wolfv. Changing this threshold to 30 greatly improves scrollling performance.

@AlexWei2013

This comment has been minimized.

Copy link

@AlexWei2013 AlexWei2013 replied Jun 6, 2013

as @wolfv's said, but why you added these codes.

@tedzhou

This comment has been minimized.

Copy link

@tedzhou tedzhou replied Jul 4, 2013

@jediofthecode

This comment has been minimized.

Copy link

@jediofthecode jediofthecode replied Aug 4, 2013

This also breaks using input[type=range] elements on touch-enabled devices, only allows stepping 1 at a time without having to release and move more.

Please sign in to comment.
You can’t perform that action at this time.