Skip to content

Commit

Permalink
Leverage touch-action whenever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
RByers authored and blvz committed Mar 29, 2017
1 parent 5dbde50 commit 76123e0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,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;
}

Expand All @@ -817,9 +817,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 (layer.style.touchAction === '' || layer.style.touchAction === 'auto') {
layer.style.touchAction = 'manipulation';
}
return true;
}

Expand Down

0 comments on commit 76123e0

Please sign in to comment.