[Bug 26809] IE11 on Win8.1 fires a click event after pointer has moved when element has touch-event: none

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26809

--- Comment #11 from Patrick H. Lauke <redux@splintered.co.uk> ---
> This works on every desktop and touch browser except for IE10/11 on touch 
> devices (Win 8.1 or Windows Phone mobiles) which use pointer events

I can only reiterate what I said all along: this is intended Pointer Events
behavior, and it is exactly the same behavior you'd see if you tried to make
your carousel slider work with the mouse. As such, it's not a bug with the
spec, or with IE's implementation of the spec...it's by design.

> How do you suggest to solve this problem with pointer events? In other words 
> how can an anchor element be moved around without triggering a click on it?

As with trying to make it work with mouse, you'd need to implement your desired
logic yourself with some basic state machine. Roughly:

- on pointerdown, keep a reference to the x/y coordinates and set a boolean
flag to indicate we're now dealing with a "pressed" state. also set another
boolean flag for "dragged" or whatever to false
- on pointermove, if "pressed" is true, check how far current x/y coordinates
are from the original x/y coordinates where the pointerdown happened. if it's
above a certain threshold (a few pixels, just to allow for some slightly
unsteading touch/mouse interaction), set the "dragged" boolean to true
- on pointerup, reset "pressed" to false
- on click, check if "dragged" is true. if so, cancel the event
(preventDefault, stopPropagation, etc). reset dragged to false

As an aside:

> Android and iOS do not trigger a click if a touchmove happens after a 
> touchstart (that's why there is the famous 300ms delay on clicks)

Not quite. the 300ms delay happens after touchend, and is there to wait and see
if there's a second touchstart coming...i.e. to check if this touch was simply
the first in a double/triple tap sequence, as the browser itself handles these.
If after 300ms there was no follow-up touch, then the browser assumes it was a
tap, and fires the mouse compat events and final click (provided there was not
too much movement / there are no other touches on the screen, etc)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 17 September 2014 10:28:14 UTC