fastclick.js?bf9a:331 Uncaught DOMException: Failed to execute ‘setSelectionRange’ on ‘HTMLInputElement’: The input element’s type (‘number’) does not support selection
解决方法:
找到node_module中的文件fastclick.js, line: 327 将
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
length = targetElement.value.length;
targetElement.setSelectionRange(length, length);
} else {
targetElement.focus();
}
替换为:
var useSelectionRange = deviceIsIOS;
if(useSelectionRange){
try{
length = targetElement.value.length;
targetElement.setSelectionRange(length, length);
}catch(error){
useSelectionRange = false;
}
}
if (!useSelectionRange) {
targetElement.focus();
}