ios webview 中,input 获取焦点 “点”的操作不要用,要用指肚去 “按” 才能获取焦点,去Github issues里找到如下解决方法:
FastClick.prototype.focus = function (targetElement) { //解决FastClick在ios输入框聚焦慢 let length; if (targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') { length = targetElement.value.length; targetElement.focus(); targetElement.setSelectionRange(length, length); } else { targetElement.focus(); } } FastClick.attach(document.body)