CookieMonster CookieMonster - 1 month ago 6
Javascript Question

Pointermove does not fire for touch on IE

I want to listen to

pointermove
event on IE11, but it seems that
pointermove
only fires for mouse (and possibly pen), but not when you are using your finger.

http://jsfiddle.net/qq2hjL2g/

Actually, the specification says that it fires for pens/mice, so this may not be really a bug.

But, is there any way to listen to pointermove on IE for touch? There must be, but I was very surprised to see
pointermove
not firing at all.

EDIT: I found that if I put CSS
touch-action: none
on the div, pointermove events fire. But why? I'm trying to find documents related to this, but I couldn't find any so far.

EDIT: I learend that the
touch-action
CSS specifies which touch actions are handled by the browser. This means setting
touch-action
to
none
tells the browser to not handle any touch events, and the developer is responsible for controlling the behaviour throutgh JavaScript events. This is why I was getting the events fired properly only when I had the CSS. (See more at MDN.)

Answer Source

I'm also trying to interface with IE11 touch. I believe MSGesture is used for touch events because in their documentation they refer to "fingers"

http://msdn.microsoft.com/en-us/library/windows/apps/hh465856.aspx

http://msdn.microsoft.com/en-US/library/ie/hh968249.aspx

I believe the gestures you are interested in are: MSGestureStart - "Triggered when the screen is touched on a location over this element."

MSGestureChange - "Triggered when the finger positions associated with the interaction moves on the screen."

MSGestureEnd - "This event fires when all associated contacts are removed from the surface"