Re: [pointerevents] Add OS image dragging to non-normative reasons for pointercancel

That's what the `drag` event type is for.

Currently, you will stop getting `pointermove` as soon as `drag` begins (in every browser).  The bug is that there's no notification that you're going to stop getting events - they just stop.  For instance, if you wanted to know how many pointers were currently down, you may increment a counter on `pointerdown` and decrement it on `pointerup` or `pointercancel`.  If `drag` starting firing, you wouldn't receive either PointerEvent, so your counter would be permanently off by 1 every time an OS drag happened.

One solution would be to add `dragstart` to the list of events that decrements the counter.  Unfortunately, this puts the author in the position of having to know every possible event that could cancel a pointer stream in every user agent.  The beautiful thing about `pointercancel` is that it tracks all that complexity for you - so long as the browser reliably fires `pointercancel` before it stops sending pointer events, it's really easy for an author to reason about when his code is handling a pointer stream vs. when the browser is.

-- 
GitHub Notification of comment by appsforartists
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/205#issuecomment-300366762 using your GitHub account

Received on Wednesday, 10 May 2017 03:55:43 UTC