Merge pull request #1160 from ansuz/focus-otp-field

set cursor in OTP input field
This commit is contained in:
wginolas 2023-07-24 09:14:51 +02:00 committed by GitHub
commit 4f6cf0f69c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -1539,6 +1539,8 @@ define([
$btn.click();
});
UI.errorLoadingScreen(block, false, exitable);
// set the user's cursor in the OTP input field
$(block).find('.cp-password-form input').focus();
};

View File

@ -938,6 +938,11 @@ define([
]);
$content.append(pwContainer);
// submit password on enter keyup
$(pwInput).on('keyup', e => {
if (e.which === 13) { $mfaRevokeBtn.click(); }
});
var spinner = UI.makeSpinner($mfaRevokeBtn);
$mfaRevokeBtn.click(function () {
var name = privateData.accountName;
@ -1004,6 +1009,11 @@ define([
}, {raw: true});
});
OTPEntry.focus();
// submit OTP on enter keyup
$OTPEntry.on('keyup', e => {
if (e.which === 13) { $d.click(); }
});
});
});
@ -1023,6 +1033,12 @@ define([
button
]));
var spinner = UI.makeSpinner($mfaSetupBtn);
// submit password on enter keyup
$(pwInput).on('keyup', e => {
if (e.which === 13) { $(button).click(); }
});
$(button).click(function () {
var name = privateData.accountName;
var password = $(pwInput).val();
@ -1175,6 +1191,11 @@ define([
])
])
]);
OTPEntry.focus();
// submit OTP on enter keyup
$OTPEntry.on('keyup', e => {
if (e.which === 13) { $(confirmOTP).click(); }
});
};