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
pressup does not fire if finger is moved before touch ends #751
Comments
I was able to get around this by adding additional listeners for touchend and mouseup on the element. You'll want to track whether or not press was fired in your onRelease callback, too. e.g.
|
@arschmitz I've encountered this a few times. Basically the TL;DR is that instead of The first interactive example here demos this behavior: http://runspired.github.io/ember-mobiletouch/#/action-area-example I've often debated whether this is a bug (pan shouldn't recognize after press has been recognized) or a feature (pan should still be recognized if a press turns into a pan). I lean towards feature, but this should probably be warned about. |
@runspired Yeah things like this come up all the time with custom events like this what events should prevent other events. Should double tap prevent a single tap or a press prevent a tap a tap prevent ( or cause ) a click etc... I tend to lean towards the non preventing route there are valid use cases for wanting both. If you only want one you should ( and i know this does not currently work here YET ) but call preventDefault and then the later events should check if default has been prevented. |
Custom gestures using |
I meet the same bug |
Closing as I believe this is by design, see my previous comment for a way to make this behave the way you want. |
the example link is not working anymore and I don't find a clear answer to this problem. |
The `Press` gesture recognizer in HammerJS has problems consistently firing a `pressup` event following a `press` event in the context of small `time` values. This is well-known. See e.g. hammerjs#1011, hammerjs#836, hammerjs#751. We've found that given a pair of `Press` and `Pan` gestures configured as below, the `pressup` event will fairly consistently break ( especially when using touch input ). This particular scenario is used for detecting a `Press` for instant setting of a position and `Pan` gradually controlling a set position ( we specifically use this for creating a "dual-ended between" variant of the `input type="range"` ): ```js { recognizers : [ [ Hammer.Pan, { direction : Hammer.DIRECTION_HORIZONTAL, threshold : 0 }], [ Hammer.Press, { threshold : 1, time : 0 }] ] }``` The root cause is with a granularity problem with browser timeouts as used in the `setTimeoutContext`, which causes part of the gesture logic to fire too late (or not at all). This issue and probably others like it, such as hammerjs#1011, hammerjs#836 or hammerjs#751 can be fixed by not using a timeout at all if the gesture's `time` property is 0.
Ok, I've had the same issue and fast googling didn't give any solution. I added another hammer listener.
You can replace |
I had the issue when using hammerjs with Ionic 2 (Angular 2+) and I manged to get it working by removing recognizers that I didn't need.
However, on Google Pixel, if I tapped my blurred overlay , even then the press up and press events were getting fired and in the wrong order 😞. |
I ended up using timeout to simulate press event.
|
Hi, Basically, the "pan-end" event fires every time you move your pointer away from the press start point and then release the press anywhere. So just by catching it, it works as same as the "press-up" event.
with |
In hammer v1.x touchrelease worked fine. Since touchrelease no longer exists in hammer v2.x I am using pressup instead. However, pressup is not fired if the finger is moved before releasing. Is this a bug, or by design? Is there a way to replicate the touchrelease functionality in hammer v2.x?
The text was updated successfully, but these errors were encountered: