rjsf-team/react-jsonschema-form

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

Open

#512 创建于 2017年3月14日

在 GitHub 查看
 (31 评论) (24 反应) (0 负责人)TypeScript (13,175 star) (2,136 fork)batch import
featurehelp wanted

描述

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.

贡献者指南

liveValidate should optionally not validate "pristine" fields (at least until a submit) · rjsf-team/react-jsonschema-form#512 | Good First Issue