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?
    {
      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'
    },
so the secondary image is also becoming a collapsable fieldset?
because it’s a nested object instead of a normal field?
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
?
i actually tried that
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'
    },
  ]
}
ah collapisable false
did it though
Awesome! Still something we should fix though; I’ll make note of it.

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.

Was this answer helpful?