New issue
Advanced search Search tips

Issue 669481 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

('ontouchstart' in window) is true

Reported by thomasfr...@googlemail.com, Nov 29 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1. Use Javascript and try to detect if it´s a touch device, like:

isTouchDevice = function is_touch_device() {
    return 'ontouchstart' in window        // works on most browsers 
        || navigator.maxTouchPoints;       // works on IE10/11 and Surface
  };
2. Chrome returns true since version ~ 54.0.2840.71

What is the expected behavior?
Return false, as it is no touch device.

What went wrong?
Chrome returns true since version ~ 54.0.2840.71

Did this work before? Yes 

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

Already described here (but no response - cause it´s marked with "WontFix" or cause it´s old?): https://bugs.chromium.org/p/chromium/issues/detail?id=467934&can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=
 

Comment 1 by rbyers@chromium.org, Nov 29 2016

Cc: dtapu...@chromium.org mustaq@chromium.org
Components: -Blink Blink>Input
Labels: Hotlist-Input-Dev
Not seeing this in Chrome Mac 54.0.2840.71 or 54.0.2840.98

So perhaps it's a generic Windows issue, or specific to some windows setup - issue 557565.  I'll try to find a non-touch Windows device to test on.

Note that this behavior is a hack that we hope to get rid of eventually -  issue 392584 .  So it's worth exploring whether this is really the sort of touchscreen check you want to be doing (as opposed, for example, to checking the pointer or any-pointer media query).  See https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/

Also please go to chrome://flags/ and click "reset all to default".  There are flags you can enable that will give you this behavior (eg. chrome://flags/#touch-events).
Labels: Needs-Feedback
Works fine on Windows 10, 54.0.2840.99

'ontouchstart' in window || navigator.maxTouchPoints;

result is 0 when typed into devtools console. There are few things that this might appear true under
1) Do you have the flag on as rbyers@ indicated?
2) Did you activate devtools? If you enter device simulation it enables touch events.

Other than that perhaps you have a device reporting that it is a hid touch capable?

Comment 3 by rbyers@chromium.org, Nov 29 2016

Thanks Dave. 

> Other than that perhaps you have a device reporting that it is a hid touch capable?

For instructions on how to answer whether that is the case see issue 557565.

If you're still able to reproduce this issue on your machine, but we can't reproduce it on any of ours, then you could use https://www.chromium.org/developers/bisect-builds-py to try to determine precisely when the behavior changed for you.
Hey Guy´s,

i had an issue in my code, which caused this chrome behavior (while working correctly at Firefox). Whatever, fixed it and everything is fine now.

Thank´s for your help and sorry for wasting your time! -_-

With kind regards

Status: WontFix (was: Unconfirmed)
Closing as per comment #4.

Sign in to add a comment