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

swipeleft and swiperight events fire when pinch-zooming #8658

Open
@teo1978

Description

@teo1978

Example code:

$(document).on("swipeleft", function(e) {
    console.log("Swipe left detected");
});
$(document).on("swiperight", function(e) {
    console.log("Swipe right detected");
});

And the viewport metatag in the html:

<meta name="viewport" content="width=device-width, initial-scale=1">

Steps to reproduce:

  1. On a real mobile device, pinch-zoom

Expected:
shouldn't ever trigger a swipe left or right event, because you are using TWO fingers. That makes it obvious that it is not a swipe gesture

Observed:
sometimes randomly triggers a swipe event while you are pinch-zooming.

I'm under the impression that you're just testing for a touch event doing a drag motion of a length and/or speed above a certain threshold, regardless of whether there are other touch points at the same time.

Instead, you should add the condition that the finger touching and dragging is the only finger present.

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