webmail: don't consume keyboard events while login form is open

e.g. ctrl-l, for going to address bar to go to another site.
This commit is contained in:
Mechiel Lukkien
2024-12-06 14:57:20 +01:00
parent e59f894a94
commit 056b571fb6
2 changed files with 4 additions and 0 deletions

View File

@ -1679,6 +1679,7 @@ let rejectsMailbox = '';
// Last known server version. For asking to reload.
let lastServerVersion = '';
const login = async (reason) => {
popupOpen = true; // Prevent global key event handler from consuming keys.
return new Promise((resolve, _) => {
const origFocus = document.activeElement;
let reasonElem;
@ -1716,6 +1717,7 @@ const login = async (reason) => {
if (origFocus && origFocus instanceof HTMLElement && origFocus.parentNode) {
origFocus.focus();
}
popupOpen = false;
resolve(token);
}
catch (err) {