You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When liveValidation is enabled, the extraErrors prop can only add errors, not clear or change them. It only clears previous extraErrors from state onSubmit().
Expected Behavior
Changing extraErrors prop immediately updates the UI.
This is necessary for cases such as:
live validation of unique key requirements, such as username availability.
RJSF is a part of larger form (onSubmit is not called within RJSF's Form component).
Prerequisites
What theme are you using?
core
Version
5.x
Current Behavior
When liveValidation is enabled, the
extraErrors
prop can only add errors, not clear or change them. It only clears previousextraErrors
from stateonSubmit()
.Expected Behavior
Changing
extraErrors
prop immediately updates the UI.This is necessary for cases such as:
Steps To Reproduce
Repo:
Observe: Extra error remains displayed.
Expected: Extra error disappears.
Also:
Observe: Extra error is duplicated in each cycle
Expected: Extra error disappears.
Environment
No response
Anything else?
When deriving state from props,
extraErrors
is merged into the existing state that already includes the extra error.https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/core/src/components/Form.tsx#L462-L466
I'm open to making a PR, but I'm not clear on what other errors RJSF may have set in the errorSchema (required fields?) or how to separate the two.
The text was updated successfully, but these errors were encountered: