rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
13.8k stars 2.16k forks source link

not working about validation #4156

Open hans000 opened 2 months ago

hans000 commented 2 months ago

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

-

Expected Behavior

-

Steps To Reproduce

  1. click submit button
  2. change input(neither click set button or type text can not cancel the error message)

https://codesandbox.io/p/devbox/rjsf-validate-gwrxj2

Environment

- OS:
- Node:
- npm:

Anything else?

No response

nickgros commented 2 months ago

Sorry, it's difficult to understand what your issue is. By default, validation only runs onSubmit. Is your issue resolved if you enable the liveValidate prop on Form, which triggers validation on change? liveValidate docs

hans000 commented 2 months ago

the liveValidate config is useful, but the initialization of the form to trigger the validation. UX is not very good.

hans000 commented 2 months ago

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Expected Behavior

Steps To Reproduce

  1. click submit button
  2. change input(neither click set button or type text can not cancel the error message)

https://codesandbox.io/p/devbox/rjsf-validate-gwrxj2

Environment

- OS:
- Node:
- npm:

Anything else?

No response

What I mean is that when there is a required form item, trigger the submit firstlly, and then after changing the value of the form item, the validation message can not be cancel.