DEV Community

Discussion on: Distance Between Two Points (SVG)

dannyengelman profile image
Danny Engelman

I have a Acer Spin laptop (with touchscreen!) running W10
maxTouchpoints returns 10 in Chromium (Chrome/Edge) and 10 in Firefox
So when you check for a > 0 value, it disables the use of the mouse
You need to always attach mousemove, and touchmove when the device has a maxTouchpoints value.
Or just bluntly always attach a touchmove handler; it will be ignored on non capable devices?

Thread Thread
zevanrosser profile image
Zevan Rosser Author

oh that explains it... I wonder why the Acer Spin doesn't register the touchmove? Sounds like pointer events is the better way to go. I feel like I've seen one of these kind of touch sniffing scripts that specifically does something with an ms prefix. Will dig a bit deeper and probably write a little thing up about it :D

Having normally used a "mobile/non-mobile" sniffing script, never really ran into this before. I do seem to remember some QA people I work with talking about something similar with the surface pro.

Thanks again for your help :D

Thread Thread
dannyengelman profile image
Danny Engelman • Edited on

It does do the touchmove. Your code needs to (always) attach a mousemove Event.

Thread Thread
zevanrosser profile image
Zevan Rosser Author

oh i see what you mean :D