fix: stop keyboard-loop on mobile camera failure + guard drawer behind login

- handleCameraError() now sets scanningActive=false and resets codeReader
  so ZXing can't fire more callbacks that re-create the manual input and
  re-focus it — mobile keyboard was popping repeatedly
- openDrawer() now checked loginOverlay.hidden before opening, so drawer
  can't appear behind the login screen
This commit is contained in:
2026-06-01 22:46:38 -04:00
parent 0f0aa1021a
commit 6322786fd2
+10
View File
@@ -2477,6 +2477,8 @@
// DRAWER
// =========================================================================
function openDrawer() {
// Don't open drawer when login overlay is showing
if (!document.getElementById('loginOverlay').classList.contains('hidden')) return;
document.getElementById('drawer').classList.add('open');
document.getElementById('drawerOverlay').classList.add('open');
// Highlight current tab in drawer
@@ -2929,6 +2931,14 @@
}
function handleCameraError(e) {
// Stop scanning so ZXing doesn't fire more callbacks that re-create the
// fallback UI in a loop — each re-create re-focuses the input, causing
// the mobile keyboard to pop repeatedly.
scanningActive = false;
if (codeReader) {
try { codeReader.reset(); } catch (_) { /* ignore */ }
codeReader = null;
}
setScanStatus('Camera failed: ' + e.message, 'error');
const ph = document.getElementById('cameraPlaceholder');
if (ph) {