使用Nexus 4,Android 4.2.1本机Chrome浏览器 - 当我点击字段时,软键盘出现,然后该字段立即失去焦点。我必须再次点击字段,并且已经打开键盘才能输入文字。
这不会发生在桌面上的Chrome中。
我在ASP用户控制下的登录表单:
Username
Password
Remember me
这似乎是这样的浏览器:
Username
Password
Remember me
我怀疑的是,ViewState是偷焦点莫名其妙。但我试过event.stopPropogation()这没有帮助。
临时修复
现在我已经定居哈克修复,点击后700毫秒迫使焦点放回元素:
jQuery('input').bind('click',function(evt) {
var focusClosure = (function(inputElem) {return function() {console.log(inputElem.focus());}}($(evt.target)));
window.setTimeout(focusClosure, 700);
});
+0
我发现提到的[类似的问题(http://stackoverflow.com/questions/9147400/edittext-steals-focus),但这些似乎都与Java相关的 - 本地应用程序中。我无法在网页中找到任何其他关于此问题的提及。 –
2013-02-13 13:19:03