-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Changing direction during pan not recognised #748
Conversation
Fix for changing direction during pan not being recognised http://stackoverflow.com/questions/21905554/detect-the-direction-change-on-hammer-js-event
I've tried this fix, it broke 'pan'. |
You could keep track of the position change since the last change yourself, for instance (using the dom events version);
|
@arschmitz I would close this as not a bug. The deltas are distance from the origin event (and should be), there is a direction attribute already, and you can keep track of smaller deltas yourself as needed. I do, however, think having both an |
I agree maybe open a new issue for discussion on that? |
closing this in favor of #806 |
My issue was it didn't pan back until you'd passed the origin so pan drags were uni-directional rather than responsive. e.g. based on max extent rather than current relative position from origin. |
@benaadams ok so i think that potentially makes sense and is worth considering as it should be a simple change. I'm going to reopen this for more discussion. So to clarify you believe we should report the current distance from the origin vs the max distance ( as it does now ) |
Yes, so it follows you finger rather than being a single direction/locking event |
@benaadams would you be interested in updating this to not break pan but still fix the issue? |
I'm not entirely sure how it broke the pan; though I'm only testing on pointer event devices? Whereas it seemed broken before. Checking my assumption: Pan should follow finger, if you move left it should go left, if you start going right it should start moving back - so your finger is always above the bit that is moving? Previously it would lock and only start going back once you passed the origin of the gesture start. |
@benaadams not sure but guessing if you fix the test failures it will fix pan. Semi related if you are experiencing issues with pointer events devices please report them we do have test devices now and will make sure these issues are fixed. Pointer events are the direction we plan on taking this library and are top priority. We even have members of the pointer events working group and browser vendors helping in this respect with the project and are working with PEP the team ( pointer events polyfill ). |
I revisited this, and reconfirmed by original belief that this is not a bug. Currently, the delta is the distance from the original event, not the last event. While it is useful to have a "current delta", that can be done on your own currently, and should become a feature in the next minor. E.G. as stated earlier:
|
The issue I was experiencing is it wasn't the the correct delta from the origin event; rather the furthest delta from the origin event; so if I moved +5 X; delta would be +5 X; if I then moved -1 X, the delta would still be +5 X; rather than +4 X |
I've confirmed that's not the case, you had to have been dealing with a cached event or some such. |
Might have been using it wrong; sounds like I was using the delta delta from the feedback |
Fix for changing direction during pan not being recognised.
e.g. http://stackoverflow.com/questions/21905554/detect-the-direction-change-on-hammer-js-event
Currently deltaX and deltaY don't reverse until the input passes the start of pan