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

deltaX is inverted #166

Closed
untitledlt opened this issue Oct 29, 2019 · 3 comments
Closed

deltaX is inverted #166

untitledlt opened this issue Oct 29, 2019 · 3 comments
Labels
Milestone

Comments

@untitledlt
Copy link

Describe the bug
Swiping from left to right returns negative deltaX value.
That kinda feels inverted as other libs (f.e. hammer.js) returns positive.

Swiping from bottom to top produces positive deltaY value, so only X axis is inverted.

Steps or Sandbox to reproduce
https://codesandbox.io/s/react-swipeable-hook-deltax-inverted-f4net

Expected behavior
Swiping from left to right should produce positive deltaX and swiping from right to left should produce negative deltaX value.

** Device/Browser **
Version 78.0.3904.70 (Official Build) (64-bit)

@hartzis
Copy link
Collaborator

hartzis commented Nov 26, 2019

Hey @untitledlt , thank you for the issue. I think this is related to #157 .

I'd like to see this standardized in the next major release, v6.

In the meantime does absX work for you?

@tfreeborough
Copy link

Not OP but can confirm that i was terribly confused until I found this ticket.

I'm building a touch swipe component and ended up using the following to get the current X position within the component

const currentX = eventData.initial[0] + eventData.absX;

@hartzis hartzis added this to the v6 milestone Nov 28, 2019
@hartzis
Copy link
Collaborator

hartzis commented Aug 18, 2020

Closing in favor of #157 to track progress

@hartzis hartzis closed this as completed Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants