https://caniuse.com/#feat=pointer - now you can use one unified event capture everywhere, instead of having to choose between "click" and "touch"!
https://caniuse.com/#feat=pointer - now you can use one unified event capture everywhere, instead of having to choose between "click" and "touch"!
For example, if you want to roll your own "drag" event for a given element, the API allows you to do this without reference to document or a parent container element. You can just declare that the element currently receiving pointer events capture subsequent pointer events until you release it[1].
Additionally, the API naturally lends itself to patterns that can easily be extended for multi-touch situations.
I'm quite curious which developer led the charge for this API and how they warded off committee meddling by people who lacked knowledge about the benefits of this approach.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Element/set...
In my experience writing a component suite I have found I don't use touch[a-z]+ events that much (just like mouse[a-z]+ events don't get used much either).
I would be very careful before believing the promise of Pointer Events, unless you need to be on the bleeding edge for some reason. When I first used Pointer Events, there were heaps of corner cases that bit me hard. I would be especially careful if using them with virtual Dom updates or very dynamic pages - one of the worst pain points was issues with events when elements were deleted/replaced.
What does vdom diffing / dynamic page content have to do with using pointer/touch/mouse events?
If anything, the last scenario you describe sounds like it would be mitigated by use of https://developer.mozilla.org/en-US/docs/Web/API/Element/set... which is only available to PointerEvent implementations?
Maybe the support has improved in Chrome and Firefox, but I would be very careful to test Safari support before I relied 100% upon Touch Events.