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:
@@ -2477,6 +2477,8 @@
|
|||||||
// DRAWER
|
// DRAWER
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
function openDrawer() {
|
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('drawer').classList.add('open');
|
||||||
document.getElementById('drawerOverlay').classList.add('open');
|
document.getElementById('drawerOverlay').classList.add('open');
|
||||||
// Highlight current tab in drawer
|
// Highlight current tab in drawer
|
||||||
@@ -2929,6 +2931,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleCameraError(e) {
|
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');
|
setScanStatus('Camera failed: ' + e.message, 'error');
|
||||||
const ph = document.getElementById('cameraPlaceholder');
|
const ph = document.getElementById('cameraPlaceholder');
|
||||||
if (ph) {
|
if (ph) {
|
||||||
|
|||||||
Reference in New Issue
Block a user