Closed aishahsofea closed 3 months ago
Reproduced Same in v3 https://codesandbox.io/s/late-https-f2zce
I'm not sure we can do something for this. Form validation is managed by react-final-form (or redux-form in v2). It seems they both don't care that a change made on a field can trigger a dynamic validation error on another field.
I tryed using multi validation functions instead of a unique validation function having multl messages, but it doesn't change the behaviour
@JulienMattiussi is there any workaround (that probably ditches redux-form)?
To circumvent this I am passing validateOnBlur={true}
to the form, but that messed with my ImageInput
validation because it never blurs. I guess it could help you if you don't have also an image in your form.
I had same problem. And I prefer If you want to validate between multiple value use allValues field
validate={[
required(),
minValue(),
...
anyCustom,
]}
//value: value of current input
//allValues : all values of current form
const anyCustom = (value, allValues) => {
if (...) {
return errorMessage : string
}
return undefined
}
With the release of react-admin v5, react-admin v3 has reached its end of life. We won't fix bugs or make any new release on the 3.x branch. We recommend that you switch to a more recent version of react-admin.
So I'm closing this issue as we won't fix it.
What you were expecting: I am expecting that validation will change according to the selected value in SelectInput dropdown.
What happened instead: It validates against the previously selected value.
Steps to reproduce:
Related code: Code is in PostReferenceInput.js I reproduced this issue in this codesandbox
Other information:
Environment