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

Closed
wants to merge 1 commit into
from

3 participants

@tvpmb
  • 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
@roblarsen

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

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

@tvpmb

@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.

@roblarsen

A Lenovo Yoga 13

@stucox
Modernizr member

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 stucox closed this May 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment