buffix apple

This commit is contained in:
MEGASOL\simon.adams
2025-09-21 10:03:15 +02:00
parent df4d33a7d4
commit 519abb8f3a
3 changed files with 15 additions and 2 deletions

View File

@@ -353,6 +353,20 @@ dz.addEventListener('drop', (e)=>{
// --- Mobile-safe file input change handler ---
const isTouch = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
// On iOS Safari, the `capture` attribute forces camera-only and hides Photo Library.
// Keep camera default on Android, but remove capture elsewhere to allow picking from Photos/Files.
try {
const ua = (navigator.userAgent || navigator.vendor || window.opera || '');
const isAndroid = /Android/i.test(ua);
if (fi) {
if (isAndroid) {
fi.setAttribute('capture', 'environment');
} else {
fi.removeAttribute('capture');
}
}
} catch {}
let suppressClicksUntil = 0;
if (isTouch && dropHint) {
try { dropHint.classList.add('hidden'); } catch {}