🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fastclick

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastclick - npm Package Compare versions

Comparing version

to
0.6.11

build/fastclick.min.js

24

lib/fastclick.js
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @version 0.6.9
* @version 0.6.11
* @codingstandard ftlabs-jsv2

@@ -248,4 +248,5 @@ * @copyright The Financial Times Limited [All Rights Reserved]

case 'textarea':
return true;
case 'select':
return true;
return !this.deviceIsAndroid;
case 'input':

@@ -289,3 +290,3 @@ switch (target.type) {

clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent('click', true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.forwardedTouchEvent = true;

@@ -295,3 +296,14 @@ targetElement.dispatchEvent(clickEvent);

FastClick.prototype.determineEventType = function(targetElement) {
'use strict;'
//Issue #159: Android Chrome Select Box does not open with a synthetic click event
if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
return 'mousedown';
}
return 'click';
}
/**

@@ -304,3 +316,4 @@ * @param {EventTarget|Element} targetElement

if (this.deviceIsIOS && targetElement.setSelectionRange) {
// Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
if (this.deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') {
length = targetElement.value.length;

@@ -514,2 +527,5 @@ targetElement.setSelectionRange(length, length);

// Reset to prevent wrong click cancel on input (issue #156).
this.cancelNextClick = false;
this.lastClickTime = event.timeStamp;

@@ -516,0 +532,0 @@

2

package.json
{
"name": "fastclick",
"version": "0.6.10",
"version": "0.6.11",
"description": "Polyfill to remove click delays on browsers with touch UIs.",

@@ -5,0 +5,0 @@ "maintainers": [