Lack of Explicit Custom Validation on Properties/Fields #573
Labels
enhancement
New feature or request
Sponsorable
If you need this feature, you can contact us for sponsoring it. Or submit a PR!
Description
Hello everyone,
While FireCMS provides the ability to create custom fields by passing a React component to the
fieldConfig
prop, it lacks explicit documentation or features for adding custom validation logic to these fields. Correct me if im wrong. 😄Example
Consider a scenario where we have a
role
field and anage
field in the schema. Therole
field should only accept numbers that are multiples of 3, and theage
field should only accept numbers between 18 and 60, inclusive.Suggested Solution
Introduce a
customValidation
function property to the field definition, allowing developers to specify custom validation logic. This function could return a string to indicate a validation error or null if the value is valid.Thank you for your feedback.
The text was updated successfully, but these errors were encountered: