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