N
Nuxt5mo ago
Flamur

File input not working on ios (Safari or Chrome)

Hi, as the title says, the files in the native ios file browser are not being highlighted (they're grayed out) and I can't select them, here's the "simplified" code:
<form @submit.prevent="handleSubmit">
<input
@change="handleFileChange"
type="file"
accept="audio/*"
/>
<button type="submit">Upload</button>
</form>
<script setup lang="ts">
const file = ref<File | null>(null);

function handleFileChange(event: Event) {
const input = event.target as HTMLInputElement;
code...
}
</script>
<form @submit.prevent="handleSubmit">
<input
@change="handleFileChange"
type="file"
accept="audio/*"
/>
<button type="submit">Upload</button>
</form>
<script setup lang="ts">
const file = ref<File | null>(null);

function handleFileChange(event: Event) {
const input = event.target as HTMLInputElement;
code...
}
</script>
and also how the files look:
No description
1 Reply
Flamur
FlamurOP5mo ago
android and windows desktop chrome works well bthw

Did you find this page helpful?