Skip to content

Commit a5881ea

Browse files
committed
fix(gestures): improve drag/swipe response
Fixes #1729, #2674
1 parent 9dbef80 commit a5881ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: js/utils/gestures.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@
11081108
defaults: {
11091109
// set 0 for unlimited, but this can conflict with transform
11101110
swipe_max_touches : 1,
1111-
swipe_velocity : 0.7
1111+
swipe_velocity : 0.4
11121112
},
11131113
handler: function swipeGesture(ev, inst) {
11141114
if(ev.eventType == ionic.Gestures.EVENT_END) {
@@ -1164,6 +1164,15 @@
11641164
},
11651165
triggered: false,
11661166
handler: function dragGesture(ev, inst) {
1167+
1168+
if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {
1169+
this.preventedFirstMove = false;
1170+
1171+
} else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {
1172+
ev.srcEvent.preventDefault();
1173+
this.preventedFirstMove = true;
1174+
}
1175+
11671176
// current gesture isnt drag, but dragged is true
11681177
// this means an other gesture is busy. now call dragend
11691178
if(ionic.Gestures.detection.current.name != this.name && this.triggered) {

0 commit comments

Comments
 (0)