sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Portable Text - Multiple custom annotations are not editable separately

Open phmasek opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug

It is not possible to edit the options for each annotation separately when selecting multiple custom annotations to a text in a Portable Text component.

To Reproduce

  1. Make sure you have installed sanity install @sanity/color-input
  2. Create this schema for a custom component:
export default {
  title: 'Body text',
  name: 'body',
  type: 'array',
  of: [
    {
      type: 'block',
      lists: [],
      marks: {
        decorators: [],
        annotations: [
          {
            name: 'externalLink',
            type: 'object',
            title: 'External link',
            fields: [
              {
                name: 'href',
                type: 'url',
                title: 'Href',
              },
            ],
          },
          { name: 'color', title: 'Color', type: 'color' }
        ],
      },
      styles: [
        { title: 'Normal', value: 'normal' },
        { title: 'H2', value: 'h2' },
        { title: 'H3', value: 'h3' },
      ],
    },
  ],
};
  1. Add the component as a field in a document
  2. Write some text in the field
  3. Select the text and add an external link.
  4. Select the same text and select a color.

Expected behavior

Being able to edit each annotation type separately. Maybe adding all options in the tooltip suggestion (see image) that pops up when selecting the text?

Screenshots

image

Which versions of Sanity are you using?

@sanity/cli                 2.22.0 (up to date)
@sanity/base                2.22.0 (up to date)
@sanity/color-input         2.22.0 (up to date)
@sanity/core                2.22.0 (up to date)
@sanity/default-layout      2.22.0 (up to date)
@sanity/default-login       2.22.0 (up to date)
@sanity/desk-tool           2.22.2 (up to date)
@sanity/production-preview  2.15.0 (up to date)
@sanity/vision              2.22.0 (up to date)

What operating system are you using?

N/A

Which versions of Node.js / npm are you running?

8.1.4
v17.1.0

Additional context

N/A

Security issue?

No.

phmasek avatar Nov 25 '21 12:11 phmasek

@phmasek - thank you for reporting this issue. It's on our radar, overlapping annotations support is something we want too.

skogsmaskin avatar Nov 25 '21 12:11 skogsmaskin

Any update on this feature? Would be great if this is possible 👍

maitzeth avatar Jul 04 '22 15:07 maitzeth

+1

BennyZ28 avatar Aug 08 '22 11:08 BennyZ28

+1

Mikaila94 avatar Sep 15 '22 07:09 Mikaila94

Has there been any update on this? Have just come across a use case where this would be ideal!

stevenbister avatar Oct 27 '22 14:10 stevenbister

Hi!

We are currently working on improving our workflows and follow-up on our open GitHub repository. In that work, we have decided to close most issues older than the release of Sanity Studio v3.

We value your feedback, so if this issue is still important to you and relevant for Sanity Studio v3, please search for relevant open issues. If you can’t find any, open a new one and link to relevant comments in this thread. For questions about how to do something, please post them in the slack community.

kmelve avatar Jan 13 '23 09:01 kmelve