From b5b29aeb1770b788a5a98fe966fbb67b2cb485ca Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Mon, 12 Feb 2018 09:53:34 -0800 Subject: [PATCH] focus download password input on render. fixes #745 --- app/templates/downloadPassword.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/templates/downloadPassword.js b/app/templates/downloadPassword.js index 6b9a7cad..bca7ccf1 100644 --- a/app/templates/downloadPassword.js +++ b/app/templates/downloadPassword.js @@ -22,8 +22,7 @@ module.exports = function(state, emit) { autocomplete="off" placeholder="${state.translate('unlockInputPlaceholder')}" oninput=${inputChanged} - type="password" - autofocus /> + type="password" /> `; + if (!(div instanceof String)) { + setTimeout(() => document.querySelector('#unlock-input').focus()); + } + function inputChanged() { const input = document.getElementById('unlock-input'); const btn = document.getElementById('unlock-btn');