getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Required field inside inactive tab breaks page saving #2286

Open woutgg opened 2 years ago

woutgg commented 2 years ago

I have defined a custom blueprint for calendar event pages that uses tabs for organizing the various input fields. It works nicely, except for this one thing where a required field (event date in this case) on a tab that is currently not active will prevent saving the page without any error or other type of feedback.

A quick search led me to #1393, which appears to be about the same underlying issue. I'm also seeing a similar error: An invalid form control with name='data[header][dates][start_date]' is not focusable..

A minimal version of the field definition looks as follows:

data_tabs:
  type: tabs
  fields:
    header.event:
      type: tab
      title: Event info
      fields:
        .name:
          type: text
          label: Name
          validate:
            required: true
    header.dates:
      type: tab
      title: Dates
      fields:
        .start_date:
          type: date
          label: Start date
          validate:
            required: true