decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.7k stars 3.03k forks source link

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

Open isabellaslv opened 8 months ago

isabellaslv commented 8 months ago

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: