Skip to content

RegisterEditorComponent (custom widget) FIELDS - Required not working #6986

@isabellaslv

Description

@isabellaslv

Describe the bug
The 'required' and 'pattern' for custom widgets is not working.
It shouldn't allow to save the updates if all required fields are not filled.
image

To Reproduce

  1. Create a custom widget using CMS.registerEditorComponent
  2. Set a field as required: true
  3. Insert the widget inside the markdown and don't fill the required field
  4. Save the updates

window.CMS.registerEditorComponent({ id: 'collection', label: 'Collection', collapsed: true, fields: [ { label: 'Cards', name: 'cards', widget: 'list', fields: [ { label: 'Title', name: 'title', widget: 'string', required: true, }, ]

Expected behavior
Won't allow save the updates since the field is mandatory.

Applicable Versions:

  • netlify-cms-app 2.15.72
  • netlify-cms-core 2.55.2
  • netlify-cms 2.10.192
  • Git provider: gitlab
  • OS: windows 10
  • Node.JS version: 16.16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions