[Proposal] Event for user gestures / swipe

This is the major source of reference:

The problem is that if you try those solutions are not reliable. I have just tested them on Chrome / Android / Galazy S10+;

For example if you listen for swipe, very often a pinch-to-zoom gesture triggers the swipe, resulting in an unreliable, terrible user experience. It should be easier for the OS / browser to detect the actual gesture.


After two days of trials, I give up. I have tried all the solutions listed in the above StackOverflow post, I have tried custom code, but the way we have to detect the swipe does not work well with native zoom. Basically the zoom often triggers a swipe for no reason and some libraries even disable the zoom to ignore this issue.

Browsers should really provide a more reliable event.

From memory, part of the problem here is intellectual property / patents related. One company in particular has, in the past, been very protective of not allowing standards development of these sorts of gesture detection high-level APIs.

While some initial APIs are available, like https://developer.mozilla.org/en-US/docs/Web/API/GestureEvent and https://developer.mozilla.org/en-US/docs/Web/API/MSGestureEvent these are proprietary.

Agree that it would be great to have some standardised method here (leaving IPR issues aside). Otherwise, authors will have to keep relying on homebrewed detection, or utility libraries such as https://hammerjs.github.io/

1 Like

I have tried Hammer.js, but unfortunately it disables the native pinch-to-zoom feature, as other libraries do, and that is not acceptable for my application from an accessibility point of view.

1 Like

I am working on instagram story like UI where such events are of great use. I agree to author that disabling pinch to zoom is not a good idea, but in current state of web, if we are to detect swipe events then we need to disable pinch-to-zoom.