#880 - Simple fix to improve the detection for real touch based devices #920

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

tvpmb commented May 3, 2013

  • fixes the false positive seen on Windows 8 (Chrome, FF)
@tvpmb tvpmb Simple fix to improve the detection for real touch based devices
- fixes the false positive seen on Windows 8 (Chrome, FF)
048976e
Contributor

roblarsen commented May 3, 2013

I'm not sure what you're testing on, but that produces two different results on a touch enabled Win8 laptop.

in FF latest

>>> typeof window.Touch

"object"

in Chrome latest

>typeof window.Touch
"function"

the original test ("ontouchstart" in window) is true on both

tvpmb commented May 3, 2013

Yeah, I don't have that type of device to test against...let me think about this some more.

tvpmb commented May 3, 2013

@roblarsen Just curious, what's the make/model of that device? One of the guys here has a surface pro, trying to find something to test against.

Contributor

roblarsen commented May 3, 2013

A Lenovo Yoga 13

Owner

stucox commented May 4, 2013

Ok, to clairfy once again, Modernizr.touch is not intended to detect touch devices. It detects support for the Touch Events API, which I think this test does reliably... the exceptions seen on #880 seem to be cases whereby the APIs are enabled unexpectedly.

We don't believe it's currently possible to detect touch-capable devices reliably... see this thread: #548.

So I'm afraid I'm going to kill this. Let's carry on the discussion about why we're getting false-positives in Win 8 on #880.

stucox closed this May 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment