You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
App.SampleView = Ember.View.extend({
swipeOptions: {
direction: Em.OneGestureDirection.Left | Em.OneGestureDirection.Right,
cancelPeriod: 100,
swipeThreshold: 100
},
touchMove: function(event) {
// Do not prevent event bubbling since we need native vertical scrolling
//event.preventDefault();
},
swipeEnd: function(recognizer, evt) {
var direction = recognizer.get('swipeDirection');
if (direction === Em.OneGestureDirection.Right) {
alert('Swipe Right');
} else if (direction === Em.OneGestureDirection.Left) {
alert('Swipe Left');
}
},
});
The code acts as expected on many browsers / mobile platforms (Safari + iPhone, Firefox + Android, Android Internet Browser + Android). It recognizes the horizontal swipes while vertical scrolling is properly handled by the browser.
But it doesn't work on Chrome V29 on Android on both my devices (Google Nexus 7 V1 and Samsung Galaxy Nexus).
The only way I found to make ember-touch notice the swipes on Chrome was by preventing the default action in touchMove(). But this breaks vertical scrolling.