マークアップ:
<section id="loginform">
<input type="text" id="username" placeholder="Username"/>
<input type="password" id="password" placeholder="Password"/>
<input type="submit" value="login" id="login"/>
</section>
JavaScript:
$('#loginform #username').bind('touchstart', function(e) {
$(this).focus()
})
$('#loginform #password').bind('touchstart', function() {
$(this).focus()
})
Android(4.0)でこのサイトを開き、ユーザー名またはパスワードの入力フィールドをクリックしても、キーボードがポップアップしません...次のようなコードを実行すると、次のようになります。
$('#loginform #username').bind('touchstart', function(e) {
alert("android why u no keyboard show!?")
$(this).focus()
})
次に、キーボードがポップアップします...アラートe.isDefaultPrevented()
が返されますfalse
何が間違っている可能性があるかについてのアイデアはありますか?
ありがとう