Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

ios下导致文本框聚焦困难 #582

Open
liu-xinhui opened this issue Apr 11, 2019 · 4 comments
Open

ios下导致文本框聚焦困难 #582

liu-xinhui opened this issue Apr 11, 2019 · 4 comments

Comments

@liu-xinhui
Copy link

需要点击好多次文本框,键盘才会弹出

@liu-xinhui liu-xinhui changed the title ios下回导致文本框聚焦困难 ios下导致文本框聚焦困难 Apr 11, 2019
@linking2014
Copy link

需要点击好多次文本框,键盘才会弹出

这里有篇文章
http://www.php.cn/js-tutorial-387360.html

@betterTry
Copy link

@webyuanzheng
Copy link

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();
}
}
//加上这段代码完美解决

@AntiMoron
Copy link

我能被这个库气死。接手一下很久的项目看了半天 还奇怪为啥、

在contenteditable的div上试了真的有半天的时间都无解

试试注释掉以前的人在公共文件里写的FastClick.attech(body)就好了,

然后才找到本帖save my day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants