6

I have a lot of tags, and I need to select a lot for each document. It is uncomfortable to click one by one every time. Also I see selected elements. How can I remake it into somefield like a multiselect? It could be even native. Or how to select all tags at once?

I am using array:

{
  title: 'Language',
  name: 'language',
  type: 'array',
  options: {
    layout: 'grid'
  },
  of: [{
    type: 'reference',
    title: 'Lang',
    to: {
      type: 'settingLanguages'
    }
  }],
},

enter image description here

thomax
  • 9,213
  • 3
  • 49
  • 68
kizoso
  • 1,216
  • 2
  • 15
  • 30
  • 2
    It would be really cool if you could check the correct answers as "answered" even if it the answers boil down to "sorry, there's no easy way to do that" :) – thomax Apr 23 '19 at 12:18
  • @thomax it is an important point.! I am going to answer in the coming days. – kizoso Apr 25 '19 at 08:44
  • ^I've the same issue, do you have an answer? – Paolo Feb 04 '20 at 00:49
  • 1
    @Paolo Unfortunately, no. If you find a solution, please share it. We need to extend their react component for that. – kizoso Feb 05 '20 at 09:28
  • 1
    @Paolo you can try ask a question in a https://sanity-io-land.slack.com/ it's the only one I've been using lately – kizoso Feb 05 '20 at 09:32

2 Answers2

8

Dropdown example (Add field to schema):

{
  title: 'Genre',
  name: 'genre',
  type: 'string',
  options: {
    list: [
      { title: 'Sci-Fi', value: 'sci-fi' },
      { title: 'Western', value: 'western' },
    ],
  },
},
Wallace Sidhrée
  • 11,221
  • 6
  • 47
  • 58
Jeremy Tenjo
  • 587
  • 5
  • 9
2

This is currently not possible out of the box with the default array component, but you should be able to create an input like this by building a custom input for it with the behaviour you want.

More on how to build custom inputs: https://www.sanity.io/docs/extending/custom-input-widgets