移动端iOS中input聚焦不灵敏
<script src='/path/to/fastclick.js'></script> 或者npm 安装
FastClick.attach(document.body); FastClick.prototype.focus = function (targetElement) { 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(); } }
转载:https://www.jianshu.com/p/053454429e0d