Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ons.platform._runOnActualPlatform(() => {
if (ons.platform.isAndroid()) {
// In Android4.4+, correct viewport settings can remove click delay.
// So disable FastClick on Android.
ons.fastClick.destroy();
} else if (ons.platform.isIOS()) {
if (supportTouchAction && (ons.platform.isIOSSafari() || ons.platform.isWKWebView())) {
// If 'touch-action' supported in iOS Safari or WKWebView, disable FastClick.
ons.fastClick.destroy();
} else {
// Do nothing. 'touch-action: manipulation' has no effect on UIWebView.
}
}
});
}, false);
window.addEventListener('load', () => {
ons.fastClick = FastClick.attach(document.body);
const supportTouchAction = 'touch-action' in document.body.style;
ons.platform._runOnActualPlatform(() => {
if (ons.platform.isAndroid()) {
// In Android4.4+, correct viewport settings can remove click delay.
// So disable FastClick on Android.
ons.fastClick.destroy();
} else if (ons.platform.isIOS()) {
if (supportTouchAction && (ons.platform.isIOSSafari() || ons.platform.isWKWebView())) {
// If 'touch-action' supported in iOS Safari or WKWebView, disable FastClick.
ons.fastClick.destroy();
} else {
// Do nothing. 'touch-action: manipulation' has no effect on UIWebView.
}
}
});
}, false);