-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.x
Current Behavior
When I pass (data, errors) => errors
into the customValidate parameter, changing other inputs in the form causes the existing error messages to sometimes appear and sometimes disappear
Expected Behavior
When I pass (data, errors) => errors
into the customValidate parameter, changing other inputs in the form causes the existing error messages to remain displayed
Steps To Reproduce
- Create a form using the following code:
<RJSFForm
showErrorList={false}
liveValidate
customValidate={(data, errors, uiSchema) => {
return errors;
}}
schema={{
type: "object",
properties: {
field1: {
type: "number",
enum: [1, 2, 3],
},
field2: {
type: "number",
minimum: 42,
maximum: 100,
},
},
}}
uiSchema={{
field1: {
"ui:options": {
widget: "radio",
},
},
field2: {},
}}
validator={validator}
/>
- Enter 1 in field2
- Switch field1 multiple times and observe the error message under field2.
A codesandbox example: https://codesandbox.io/p/sandbox/j2kdsr?file=%2Fsrc%2FApp.tsx%3A34%2C13
Environment
- OS: windows
- Node: 22
- npm: 10