Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child fields in objects (in arrays) do not render #8682

Open
cyanonoob opened this issue Jul 10, 2023 · 0 comments
Open

Child fields in objects (in arrays) do not render #8682

cyanonoob opened this issue Jul 10, 2023 · 0 comments

Comments

@cyanonoob
Copy link

cyanonoob commented Jul 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant