buffix apple
This commit is contained in:
@@ -353,6 +353,20 @@ dz.addEventListener('drop', (e)=>{
|
|||||||
|
|
||||||
// --- Mobile-safe file input change handler ---
|
// --- Mobile-safe file input change handler ---
|
||||||
const isTouch = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
|
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;
|
let suppressClicksUntil = 0;
|
||||||
if (isTouch && dropHint) {
|
if (isTouch && dropHint) {
|
||||||
try { dropHint.classList.add('hidden'); } catch {}
|
try { dropHint.classList.add('hidden'); } catch {}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
type="file"
|
type="file"
|
||||||
multiple
|
multiple
|
||||||
accept="image/*,video/*"
|
accept="image/*,video/*"
|
||||||
capture="environment"
|
|
||||||
class="absolute inset-0 opacity-0 cursor-pointer" />
|
class="absolute inset-0 opacity-0 cursor-pointer" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<div class="mt-3 relative inline-block">
|
<div class="mt-3 relative inline-block">
|
||||||
<label class="rounded-2xl bg-black text-white dark:bg-white dark:text-black px-5 py-3 hover:opacity-90 cursor-pointer select-none" aria-label="Choose files">
|
<label class="rounded-2xl bg-black text-white dark:bg-white dark:text-black px-5 py-3 hover:opacity-90 cursor-pointer select-none" aria-label="Choose files">
|
||||||
Choose files
|
Choose files
|
||||||
<input id="fileInput" type="file" multiple accept="image/*,video/*" capture="environment" class="absolute inset-0 opacity-0 cursor-pointer" />
|
<input id="fileInput" type="file" multiple accept="image/*,video/*" class="absolute inset-0 opacity-0 cursor-pointer" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 text-sm text-gray-500 dark:text-gray-400">
|
<div class="mt-4 text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
|||||||
Reference in New Issue
Block a user