vue 引入fastclick插件 ios鍵盤沒法調起或者反應慢

FastClick.prototype.focus = function(targetElement) { 

 var length; // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.prototype

 if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {element

 length = targetElement.value.length;get

 targetElement.focus();

 targetElement.setSelectionRange(length, length); input

 } else {原型

 targetElement.focus(); io

 } ast

}; function


 在原型方法下 加入 targetElement.focus(); sed

相關文章
相關標籤/搜索