[英]Chrome (Android) Keyboard carries word over to next input on js focus change
我有两个输入,当第一个输入一个Enter键时,它将重点放在下一个输入上(请参阅script标签)。 在Android(6.0.1)的Chrome(49)上,当您按下键盘(标准键盘)右下角的->按钮时,它将保留键盘中键入的最后一个单词并将其带到新输入中。
有没有这种行为的方法可以防止这种情况发生或获得类似的效果?
<input type="text" id="first-input"></input>
<input type="text"></input>
<script>
var first = document.getElementById('first-input');
first.onkeyup = function(event) {
if (event.keyCode == 13) {
first.nextElementSibling.focus();
}
}
在此处运行示例: https : //jsfiddle.net/jmn0pze7/1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.