diff --git a/lib/fastclick.js b/lib/fastclick.js index 3af4f9d6..16c0f89c 100644 --- a/lib/fastclick.js +++ b/lib/fastclick.js @@ -789,7 +789,7 @@ } // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97) - if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') { + if (layer.style.msTouchAction === 'none' || layer.style.msTouchAction === 'manipulation') { return true; } @@ -805,9 +805,13 @@ } } - // IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version - // http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx - if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') { + // Browsers that support touch-action can just use that to disable double-tap. + // https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away?hl=en + if ('touchAction' in layer.style) { + // Only 'auto' (the default) has double-tap enabled. + if (getComputedStyle(layer).touchAction === 'auto') { + layer.style.touchAction = 'manipulation'; + } return true; }