sanity icon indicating copy to clipboard operation
sanity copied to clipboard

isHighlighted option for images does not work anymore in sanity studio v3

Open kmelve opened this issue 3 years ago • 1 comments
trafficstars

Discussed in https://github.com/sanity-io/sanity/discussions/3664

Confirmed and reproducible in dev-preview.17.

Originally posted by intensr September 20, 2022

{
  title: 'Poster',
  name: 'poster',
  type: 'image',
  options: {
    hotspot: true // <-- Defaults to false
  },
  fields: [
    {
      name: 'caption',
      type: 'string',
      title: 'Caption',
      options: {
        isHighlighted: false // <-- doesnt work anymore
      }
    },
  ]
}

The is highlighted functionality for the image-type doesnt seem to work anymore in studio v3. it is not possible to hide a field anymore, each field is just shown in the same view as a regular object is displayed.

kmelve avatar Sep 20 '22 08:09 kmelve

It also seems like the field label (title) isn't autogenerated from the name value if the title prop isn't present:

{
      name: 'mainImage',
      title: 'Main image',
      type: 'image',
      options: {
        hotspot: true,
      },
      fields: [
        {
          name: 'alt',
          type: 'string',
          options: {
            isHighlighted: false
          }
        }
      ]
    },

CleanShot 2022-09-20 at 10 48 31@2x

kmelve avatar Sep 20 '22 08:09 kmelve

isHighlighted has been removed in v3. All fields defined on image types are now "highlighted" by default. If you want to hide fields from plain sight, image fields has got fieldset support in v3, so you can put these fields behind a collapsed fieldset.

bjoerge avatar Nov 21 '22 09:11 bjoerge