fastclick.js?bf9a:331 Uncaught DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selectionnode
解決方法:code
找到node_module中的文件fastclick.js, line: 327 將ip
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(); }
替換爲:element
var useSelectionRange = deviceIsIOS; if(useSelectionRange){ try{ length = targetElement.value.length; targetElement.setSelectionRange(length, length); }catch(error){ useSelectionRange = false; } } if (!useSelectionRange) { targetElement.focus(); }