Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Leverage touch-action whenever possible #499

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down