[Custom Components] must not be an array

Open
#999 2 comments 0 reactions 1 assignee View on GitHub

@Sidiro23 is already working on this.

Since Jan 15, 2025.

Assessment

This issue has not been assessed yet.

Description

question scope: community scope: custom components

I am using a custom component with the following config:

{
  type: 'cascade',
  selector: 'app-cascade',
  title: 'Cascade Select',
  group: 'basic',
  icon: 'angle-double-down',
  editForm: minimalEditForm,
  fieldOptions: ['key'],
  changeEvent: 'valueChange',
  schema: {
    customDefaultValue: (ctx) => {
      const fields = ctx.component.customOptions.filterValues;
      return fields.map((field) => ({
        key: field.selectParameter,
        value: field.defaultParameter,
      }));
    },
  },
}

Value type for the component is:

{key: string, value: string}[]

When changing value, the following error is shown as validation error:

{field_label_here} must not be an array
Dominant language
TypeScript
Stars
706
Forks
493
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from formio/angular

All issues in formio/angular

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.