@@ -2614,13 +2619,23 @@
inp.type = 'file';
inp.accept = 'image/*';
inp.capture = 'environment';
+ inp.style.display = 'none';
inp.onchange = handleManualPhotoFile;
+ // Must be in DOM for mobile Chrome to allow programmatic click
+ document.body.appendChild(inp);
inp.click();
+ // Clean up after file is picked (or cancelled)
+ inp.addEventListener('cancel', () => inp.remove());
+ // Fallback: remove after a timeout in case 'cancel' doesn't fire
+ setTimeout(() => { if (inp.parentNode) inp.remove(); }, 60000);
}
async function handleManualPhotoFile(event) {
const file = event.target.files?.[0];
if (!file) return;
+ // Clean up any dynamically created camera input
+ const inp = event.target;
+ if (inp.id !== 'manPhotoInput' && inp.parentNode) inp.remove();
manualPhotoFile = file;
manualPhotoBlob = file; // Use original file (preserves EXIF)