Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Commit

Permalink
Move setTimeout hack to where focus actually happens (bug 956959)
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinresearch committed Apr 28, 2014
1 parent fa1fbd6 commit 5302c84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 7 additions & 2 deletions media/js/cli.js
Expand Up @@ -142,8 +142,13 @@ define('cli', ['settings', 'longtext', 'tracking'], function(settings, checkLong
console.log('[cli] has nothing toShow');
}
if ($pinBox.length && !$pinBox.hasClass('error')) {
console.log('[cli] Focusing pin');
$input.focus();
// Delay required for FFOX 1.3 / FF Android (bug 956959)
// Otherwise focus is lost on first load despite the keyboard
// being already up.
window.setTimeout(function() {
console.log('[cli] Focusing pin');
$input.focus();
}, 250);
}
},
trackWebpayClick: function(e) {
Expand Down
5 changes: 1 addition & 4 deletions media/js/pin/pin.js
Expand Up @@ -163,10 +163,7 @@ require(['cli'], function(cli) {
box.html(Array(PINLENGTH+1).join('<span'+pinClass+'></span>'));
$el.prepend(box);
console.log('[pin] requesting focus on pin');
// Required for FFOX 1.3 / FF Android (bug 956959)
window.setTimeout(function() {
cli.focusOnPin();
}, 750);
cli.focusOnPin();
});

if (cli.hasTouch) {
Expand Down

0 comments on commit 5302c84

Please sign in to comment.