Unlock seamless workflows and faster delivery with our latest releases – get the details

Nested object in fieldset causing unintentional double collapse

10 replies
Last updated: Oct 1, 2020
I have an object inside of a fieldset, and it’s creating a double collapsed experience which seems unintentional but I can’t seem to disable it?
Oct 1, 2020, 5:12 PM
    {
      type: 'image',
      name: 'image',
      title: 'Core Image',
      fieldset: 'media'
    },
    {
      ...image,
      name: 'secondaryImage',
      description: 'Shows up on the Product Landing Spice Stats Module',
      title: 'Secondary Image',
      fieldset: 'media'
    },
Oct 1, 2020, 5:12 PM
so the secondary image is also becoming a collapsable fieldset?
Oct 1, 2020, 5:12 PM
because it’s a nested object instead of a normal field?
Oct 1, 2020, 5:12 PM
Hmm this feels like a bug where the object inherits the option from the fieldset. Could you try setting
collapsed: false
on the
secondaryImage
object? Or otherwise
collapsible: false
?
Oct 1, 2020, 5:21 PM
i actually tried that
Oct 1, 2020, 5:22 PM
export const image =  {
  name: "image",
  title: "Image",
  type: "object",
  options: {
    collapsed: false
  },
  fields: [
    {
      name: 'image',
      type: 'image',
      title: 'Image',
      options: {
        hotspot: true
      },
      validation: Rule => Rule.required()
    },
    {
      name: 'altText',
      title: 'Alt Text',
      type: 'string'
    },
  ]
}
Oct 1, 2020, 5:22 PM
ah collapisable false
Oct 1, 2020, 5:22 PM
did it though
Oct 1, 2020, 5:22 PM
Oct 1, 2020, 5:22 PM
Awesome! Still something we should fix though; I’ll make note of it.
Oct 1, 2020, 5:27 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.

Was this answer helpful?