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)

 

参考资料:https://github.com/ftlabs/fastclick/issues?q=ios+input

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2023-04-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-20
  • 2021-04-03
  • 2023-04-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案