eclipsesource / eclipsesource/jsonforms

Support hiding error messages on load/until field is touched

Open
#1,882 6 comments 6 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

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

Dup of https://spectrum.chat/jsonforms/general/hello-everyone-does-anyone-know-how-i-can-verify-that-the-form-is-valid-i-look-in-the-examples-and-i-do-not-see-an-example-of-validation-first-of-all-thanks~204272e3-08c1-495d-a711-f4a27116cc33

We have a use case where we don't want error messages (such as the default "is a required property" for required fields) on load, and only show error messages after the user has started touching the field.

### Describe the solution you'd like

You could do
`const isValid = typeof data === 'undefined' || errors.length === 0;`
here
https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla/src/controls/InputControl.tsx#L67

### Describe alternatives you've considered

You could keep track of dirty/pristine via some state and use that prop

### Framework

React

### RendererSet

Vanilla

### Additional context

_No response_

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.