rjsf-team/react-jsonschema-form

liveValidate should optionally not validate "pristine" fields (at least until a submit)

Open

#512 opened on Mar 14, 2017

View on GitHub
 (31 comments) (24 reactions) (0 assignees)TypeScript (13,175 stars) (2,136 forks)batch import
featurehelp wanted

Description

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

In the playground, the "Validation" tab, when live validation is enabled, starts with an error ("passwords don't match"). However, the user hasn't put in a password yet, so it doesn't make sense as part of the user experience to show this error, at least until they start typing in the field.

Similarly, in the "Errors" tab, the initial state shows a bunch of errors. However, for some user experiences, this doesn't seem necessary or helpful; we're telling the user about errors that pre-existed, not errors they themselves have made.

Per https://github.com/mozilla-services/react-jsonschema-form/issues/246#issuecomment-286277405, maybe we should not validate fields until they've been "touched" somehow.

Contributor guide