getgrav / getgrav/grav-plugin-admin

Required field inside inactive tab breaks page saving

Open
#2,286 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

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:

```yaml
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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.