keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Child fields in objects (in arrays) do not render

Open cyanonoob opened this issue 2 years ago • 0 comments

Reproduction

When adding child fields in an object field, they do not render. I'm using this in an array field as below, and am stumped as to how to edit the child field in question.

// ...other componentBlock definitions
  faq: component({
    preview: (props) => {
      return (
        <NotEditable>[placeholder preview]</NotEditable>
      )
    },
    label: 'FAQ',
    schema: {
      title: fields.text({ label: 'Titel' }),      
      questions: fields.array(
        fields.object({
          question: fields.text({
            label: 'Vraag'
          }),
          answer: fields.child({
            kind: 'inline',
            placeholder: 'Antwoord',
            links: 'inherit'
          })
        }),
        { 
          label: 'Vragen',
          itemLabel: props => { return props.fields.question?.value || 'New item' }
        }
      )
    }
  }),

Expectation

The child field to render within the popup of the array field's object field.

For context

Node 18.14, recent versions of Chrome and Firefox.

cyanonoob avatar Jul 10 '23 17:07 cyanonoob