Closed solomonhawk closed 8 years ago
@ten1seven do you know whether this change can/will break other functionality of what-input
?
It shouldn't hurt anything at all. Are you proposing I replace this:
if ('ontouchstart' in document.documentElement) {
With the whole if
from Modernizr?
if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
Or just this?
if ('ontouchstart' in window) {
When testing with Chrome Emulator mode set to iPhone(or other touch device),
what-input
fails to bind thetouchstart
event since'ontouchstart' in document.documentElement
is false. Instead we should be checking for'ontouchstart' in window
which is true in Chrome when Device Emulation is active via Modernizr.http://stackoverflow.com/questions/28544445/how-to-detect-device-mode-emulation http://www.stucox.com/blog/you-cant-detect-a-touchscreen/