Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Should there be a mechanism to cancel touchstart events? #103

Closed
RByers opened this issue Oct 10, 2013 · 2 comments · Fixed by #109
Closed

Should there be a mechanism to cancel touchstart events? #103

RByers opened this issue Oct 10, 2013 · 2 comments · Fixed by #109

Comments

@RByers
Copy link

RByers commented Oct 10, 2013

Today it looks like PointerEvents only ever calls preventDefault on touchmove events.

There are scenarios where developers call preventDefault on touchstart today. The most compelling scenario is perhaps as a way to disable the long press affordance we have in chrome desktop before dispatching a contextmenu event. If Chrome were to implement pointer events natively, we'd probably make cancelling a pointerdown do that (although a CSS-based mechanism may be better).

Should PointerEvent have some way of cancelling the underlying touch event? Maybe even a 'cancelOriginalEvent()' method or something - would be a bit of a hack, but probably better than the alternative of the developer having to add a touch event listener.

There's an equivalent mouse scenarios as well that I haven't looked into as deeply. Eg. calling preventDefault on mouseDown disables text selection, and so should calling it on pointerdown. Does that already work?

@RByers
Copy link
Author

RByers commented Oct 11, 2013

Note that IE10 relies on a propritary MSHoldVisual event that can be cancelled to suppress their long press aforance: http://msdn.microsoft.com/en-us/library/ie/hh673557(v=vs.85).aspx#pointer_events.

dfreedm added a commit to dfreedm/PointerEvents that referenced this issue Nov 4, 2013
- Only way to disable some default actions
- Related to jquery-archive#103
@dfreedm
Copy link
Contributor

dfreedm commented Nov 4, 2013

I'm totally sold. Currently testing this in a branch.

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

Successfully merging a pull request may close this issue.

2 participants