fix(unlock): focus the username first when it is empty, on the quick-search path too
The autofill hotkey already picked whichever field still needed filling; quick search forced the password, so a first unlock or one without a remembered username landed the cursor in the second field.
This commit is contained in:
@@ -543,9 +543,17 @@ const Bridge = (() => {
|
||||
// Locked vault → fall through to the master-password screen.
|
||||
openQuickSearch(wasHidden, forFill) {
|
||||
if (state.locked || !state.cryptoKey || !state.token) {
|
||||
const pwd = document.getElementById('loginPassword');
|
||||
const pwd = document.getElementById('loginPassword');
|
||||
const user = document.getElementById('loginUsername');
|
||||
if (pwd && !document.getElementById('authScreen').classList.contains('is-hidden')) {
|
||||
setTimeout(() => pwd.focus(), 60);
|
||||
// Same rule as the autofill hotkey: land on whichever field
|
||||
// still needs filling. Forcing the password meant a first
|
||||
// unlock, or one without a remembered username, put the
|
||||
// cursor in the second field.
|
||||
setTimeout(() => {
|
||||
if (user && !user.value) user.focus();
|
||||
else pwd.focus();
|
||||
}, 60);
|
||||
}
|
||||
if (typeof toast === 'function')
|
||||
toast('Vault is locked — unlock to search', 'warning');
|
||||
|
||||
Reference in New Issue
Block a user