[英]input not working in phonegap app
我正在创建一个Cordova PhoneGap应用程序,输入字段有问题。
我正在使用iScroll进行滚动和刷新。
突然我的输入字段没有响应。 因此,用户甚至无法在启动应用程序时登录。
我使用标准字段,但我无法为输入字段指定焦点。 甚至在我设置“ [input] .focus()”的包装器中也没有。
html代码是
<input class="newinput" onclick="this.focus();" type="email" id="email" name="email" value="" autocorrect="off" autocapitalize="off" required="" placeholder="Enter E-mail address">
CSS是
.newinput {
width: 100%;
border: none;
padding: 0;
margin: 3px 0px 1px 0px;
background: white;
font-size: 16px;
color: #43ACDB;
z-index: 40;
}
其他样式是(可通过chrome开发者控制台找到)
-webkit-writing-mode: horizontal-tb;
font: -webkit-small-control;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-appearance: textfield;
-webkit-rtl-ordering: logical;
-webkit-user-select: text; // tried without this line too
cursor: auto;
输入字段以前曾经起作用过,但突然之间没有一个可以得到关注。 不幸的是,由于它们具有自动登录功能,因此我无法在它们停止工作时使用,因此我不使用大多数应用程序功能的输入字段。
我已经检查了所有js和css代码,并且没有以“ -webkit-user”开头的一行(调试除外)
如果我只是在Mac上的浏览器上转到index.html,但代码正常,但android模拟器以及iPhone,Android和iPad上的浏览器出现此错误
我还能做些什么才能使输入再次起作用?
确定找到了答案。 自2010年以来出现的iScroll错误就足够奇怪了。
使用以下设置:useTransform和onBeforeScrollStart。 例如
myScroll = new iScroll(
'wrapper', /** Change this to match your container ID **/
{
useTransform: true,
onBeforeScrollStart: function (e) {
var target = e.target;
while (target.nodeType != 1) {
target = target.parentNode;
}
if (target.tagName != 'SELECT' && target.tagName != 'INPUT'
&& target.tagName != 'TEXTAREA'
) {
e.preventDefault();
}
}
/** Add Any Additional Settings here **/
}
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.