From 056b571fb642d814cfbb8160f9a26cb06d7d1a70 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 6 Dec 2024 14:57:20 +0100 Subject: [PATCH] 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. --- webmail/webmail.js | 2 ++ webmail/webmail.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/webmail/webmail.js b/webmail/webmail.js index 4535659..deb358e 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -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) { diff --git a/webmail/webmail.ts b/webmail/webmail.ts index 3c24cdd..29b7d43 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -262,6 +262,7 @@ let rejectsMailbox: string = '' let lastServerVersion: string = '' const login = async (reason: string) => { + popupOpen = true // Prevent global key event handler from consuming keys. return new Promise((resolve: (v: string) => void, _) => { const origFocus = document.activeElement let reasonElem: HTMLElement @@ -308,6 +309,7 @@ const login = async (reason: string) => { if (origFocus && origFocus instanceof HTMLElement && origFocus.parentNode) { origFocus.focus() } + popupOpen = false resolve(token) } catch (err) { console.log('login error', err)