From 6322786fd2d546ead8f394ea57de183abe73a387 Mon Sep 17 00:00:00 2001 From: Shawn Date: Mon, 1 Jun 2026 22:46:38 -0400 Subject: [PATCH] fix: stop keyboard-loop on mobile camera failure + guard drawer behind login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- static/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/index.html b/static/index.html index c4ed0eb..bc620a7 100644 --- a/static/index.html +++ b/static/index.html @@ -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) {