Hello everyone,
i’m building a small website with Directus, its SDK, and Sveltekit.
Everything works like a charm but i can’t figure out an issue with the Safari browser on iOS.
The problem
For building pages content i have multiple blocks, one of these is a block_gallery which contains a multiple files input.
When i’m using iOS Safari and i first load a page that contains a gallery the results in the array are “undefined” but the array length is correct. If i navigate to another page and go back to the previous the results will appear correctly.
I don’t understand if it is a Safari issue with deep nested results or something that i’m missing.
Maybe someone can help me somehow?
Thanks to everyone that will answer!
**My code example for fetch **
For those who know Sveltekit that’s what is in my load function in page.ts
const client = getDirectusInstance(fetch);
await client.request(readItem('pages', 'home', {
fields: [
{
blocks: [
{
"item": ['*', {
block_gallery: ['*', { gallery: ['*', 'directus_files_id.*'] }]
}]
}
]
},
],
filter: {
status: { _eq: "published" }
},
}));