focus download password input on render. fixes #745

This commit is contained in:
Danny Coates 2018-02-12 09:53:34 -08:00
parent fdcf4c152a
commit b5b29aeb17
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB

View file

@ -22,8 +22,7 @@ module.exports = function(state, emit) {
autocomplete="off"
placeholder="${state.translate('unlockInputPlaceholder')}"
oninput=${inputChanged}
type="password"
autofocus />
type="password" />
<input type="submit"
id="unlock-btn"
class="btn btn-hidden"
@ -31,6 +30,10 @@ module.exports = function(state, emit) {
</form>
</div>`;
if (!(div instanceof String)) {
setTimeout(() => document.querySelector('#unlock-input').focus());
}
function inputChanged() {
const input = document.getElementById('unlock-input');
const btn = document.getElementById('unlock-btn');