Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Combined horizontal swipe and native vertical scrolling doesn't work on Android Chrome (V29) #20

@fcavelti

Description

@fcavelti

I slightly modified the sample code from http://ember-touch-website.herokuapp.com/#/swipeAndPress:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions