Clarification on the usage of the `editModal` option for object types in Sanity.io.
8 replies
Last updated: Dec 17, 2021
F
Hi all! Has anyone used the editModal option on Object type content? I was excited to see that
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.
Dec 16, 2021, 9:15 PM
F
Yup
user M
just installed the Sanity CLI and did my sanity inittoday, running
2.23.1!
Dec 16, 2021, 10:17 PM
F
I just realized there is a help channel, I apologize for dropping this in the wrong spot!
Dec 17, 2021, 2:58 PM
No worries, this is a great channel for questions, as well! I'm getting the same behavior as you, so I'm double checking usage with the team.
Dec 17, 2021, 5:58 PM
OK, I got clarity on this! The
editModalproperty is intended to only work with an object inside of the Portable Text Editor. I'm afraid it won't have any effect in an array.
Dec 17, 2021, 6:27 PM
F
Ahh appreciate it
user M
, that's too bad! I submitted a comment to update the Object docs page with a clarifying note, linking this thread.Dec 17, 2021, 6:33 PM
I just had a coworker mention that you can put the
Either way, it should be clarified!
editModaloption on the array instead of the object to get it to work. Ex:
export default { name: 'objectTesting', title: 'Object Testing', type: 'document', fields: [ { name: 'title', title: 'Title', type: 'string', }, { name: 'arrayDialog', type: 'array', options: { editModal: 'dialog', }, of: [ { name: 'objectDialog', title: 'Object Dialog', type: 'object', fields: [ { name: 'title', title: 'Title', type: 'string', }, ], }, ] }, { name: 'arrayPopover', type: 'array', options: { editModal: 'popover', }, of: [ { name: 'objectPopover', title: 'Object Popover', type: 'object', fields: [ { name: 'title', title: 'Title', type: 'string', }, ], }, ] }, { name: 'arrayFullscreen', type: 'array', options: { editModal: 'fullscreen', }, of: [ { name: 'objectFullscreen', title: 'Object Fullscreen', type: 'object', fields: [ { name: 'title', title: 'Title', type: 'string', }, ], }, ] } ], }
Dec 17, 2021, 6:45 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.