Skip to content

Commit 536219b

Browse files
authored
Merge pull request ftlabs#486 from klzns/fix/setSelectionRangeEmail
Fix inputs with type email
2 parents d4107a4 + 7972ec0 commit 536219b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fastclick.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
var length;
327327

328328
// 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.
329-
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
329+
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
330330
length = targetElement.value.length;
331331
targetElement.setSelectionRange(length, length);
332332
} else {

0 commit comments

Comments
 (0)