1.在ios系统下出现输入框需要点击多次以及重击才能选中的问题,最后发现是fastClick的点击穿透问题,添加如下代码可解决
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();
}
};
在light7的源码中添加该段代码可解决
2.IOS环境下软件弹出再收起页面无法恢复,别挤压,在input框blur的情况下可以采用
window.scroll(0,0);解决。
本文解决了iOS系统下输入框点击响应延迟及页面恢复的问题。通过修改fastClick的focus方法,解决输入框点击穿透;使用window.scroll(0,0)解决页面收起后无法正常恢复的问题。
123

被折叠的 条评论
为什么被折叠?



