decaporg / decaporg/decap-cms

[Stub] Centralize validation outside of the control component

Open
#3,167 1 comment 0 reactions 0 assignees View on GitHub
area: validation kind: discussion kind: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**

Field validation is implemented through multiple, somewhat conflicting methods that must be defined directly on the control component. If I want to do serious custom validation on a field with an existing widget, I can't - I have to make a new widget.

**Describe the solution you'd like**

Accept an `onValidate` method on the object passed to `registerWidget`. This will be difficult to do in a backwards compatible way, and should probably be brought in as a replacement for all current validation methods in the next major release.

**Additional context**

Will add issues that will be fixed/helped by this, there are quite a few.

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.