This is really annoying - when using Safari or Chrome web browser on iPad with a bluetooth keyboard, hitting the tab key quickly will freeze and later crash and restart the browser (for example, if you are a fast typist and use the login form of any website, enter user ID and quickly hit tab to enter password).
Noticed with iOS 9.3.1, iPad air and iPad mini.
This is noticed with a bluetooth keyboard when typing tab and other characters in quick succession, and is also noticed when using bluetooth barcode scanners (scan barcode that contains tab character).
I am trying to intercept the keydown event to detect tab but it is not firing when this crash occurs. Can somebody please advise?
var throttleTabKeyMs = 250; // if hits tab key must wait 250ms before next key allowed
var inputLocked = false;
window.addEventListener('keydown', function(e) {
console.log(e.which);
if (inputLocked) {
e.preventDefault();
return false;
} else if (e.which === 9) {
inputLocked = true;
setTimeout(function() {
inputLocked = false;
}, throttleTabKeyMs);
}
});
<input type='text' placeholder='type fast' />
<input type='text' placeholder='with bluetooth' />
<input type='text' placeholder='keyboard or scanner' />
<input type='text' placeholder='attached to' />
<input type='text' placeholder='your pretty ipad' />
I am trying a hack to fix it so customers can at least use their pretty iPads to do work. This experiment throttles the input so that if TAB
key is pressed then keydown
events will be dismissed until 250ms
passes (chose a value higher than I normally would to help illustrate on SO). But the problem is this code doesn't even seem to fire when hitting the bluetooth/tab bug.. must be happening lower level?
Can somebody please recommend a workaround or a different event I could use to queue up the input and prevent crashes when users enter/scan TAB
? Thanks!
TESTING: Confirmed bug on google.com and numerous other websites, so I know it is not my web application context. Other users can repro issue with iPad 2 and iPad mini.