Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect swipe from edges of the region/element? #29

Open
diegoversiani opened this issue Aug 26, 2017 · 1 comment
Open

Detect swipe from edges of the region/element? #29

diegoversiani opened this issue Aug 26, 2017 · 1 comment

Comments

@diegoversiani
Copy link

Hi,

I'm looking for a way to detect a swipe event from the left edge of the users screen to open an offside menu.

I only get one event in e.detail.events for the touchend event so I can't test if the swipe gesture started at let say < 15px from the edge:

detail:
  data:
    Array(1) 0:
      - currentDirection: 360,
      - velocity: 3.9670588235294115
  events:
    Array(1) 0:
      - l {originalEvent: TouchEvent, type: "end", x: 356.97698974609375, y: 259.302001953125, clientX: 356.97698974609375,}

Does the library support this scenario?

Thanks in advance :)

@1ubuntuuser
Copy link

I found this library very helpful for managing complicated touch events.

From memory I can't remember if the swipe start event is accessible from the swipe end event. I am inclined to say it is. If it's not, you can easily store the coordinates from the swipe start event in a variable and then access the variable in the swipe end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants