移动端iOS中input聚焦不灵敏

Posted huahaiwujiang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了移动端iOS中input聚焦不灵敏相关的知识,希望对你有一定的参考价值。

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

以上是关于移动端iOS中input聚焦不灵敏的主要内容,如果未能解决你的问题,请参考以下文章