From 5e395b0cf1b649cce9ac2f54c66b83cc73becc2d Mon Sep 17 00:00:00 2001 From: tanghaojie Date: Mon, 11 Mar 2019 15:52:32 +0800 Subject: [PATCH] add targetElement type => number --- lib/fastclick.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fastclick.js b/lib/fastclick.js index 225ff660..6f4f332f 100644 --- a/lib/fastclick.js +++ b/lib/fastclick.js @@ -326,7 +326,7 @@ var length; // Issue #160: on iOS 7, some input elements (e.g. date datetime month) 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 (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') { + if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email' && targetElement.type !== 'number') { length = targetElement.value.length; targetElement.setSelectionRange(length, length); } else {