W3C home > Mailing lists > Public > public-pointer-events@w3.org > April to June 2017

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

From: Brenton Simpson via GitHub <sysbot+gh@w3.org>
Date: Wed, 10 May 2017 03:55:36 +0000
To: public-pointer-events@w3.org
Message-ID: <issue_comment.created-300366762-1494388535-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 10 May 2017 03:55:43 UTC