Using editModal fullscreen option for array of objects in Sanity
fullscreenwas an option, but I'm not seeing any difference in editing experience when setting it. I have a field on my document type that is an
arrayof custom
objecttypes, and would love for the editing experience for each of the objects to go fullscreen.
Good news! The editModal option does work with arrays—you just need to place it in the right spot. Based on community discussions, the key is to put the editModal option on the array field itself, not on the object type definition within the array.
The Correct Configuration
Here's how to set it up:
defineField({
name: 'myArray',
type: 'array',
options: {
editModal: 'fullscreen' // Place it here on the array!
},
of: [
{
type: 'object',
name: 'myObject',
// NOT here on the object
fields: [
// your fields
]
}
]
})Available Modal Options
You have three modal types to choose from:
editModal: 'fullscreen'- Opens the array item editor in a fullscreen modaleditModal: 'dialog'- Opens in a centered dialog modal (default behavior for many object types)editModal: 'popover'- Opens in a smaller popover modal
All three options work correctly when placed on the array field's options property.
Why This Works
When you place editModal on the array itself, you're telling Sanity Studio how to handle the editing interface for items within that specific array. If you try to place it on the object type definition inside the of array, it won't have the desired effect because the array field controls the editing experience for its items.
This is particularly useful when you have complex objects with many fields—the fullscreen modal gives your content editors much more room to work with, making the editing experience significantly better than the inline default.
Give this a try and you should see your array items open in fullscreen mode as expected!
Show original thread8 replies
Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.