Global and input level validation can not be combined
See original GitHub issueThis is a follow up of https://github.com/marmelab/react-admin/issues/6270, closed because of a v3 environment bug report: https://github.com/marmelab/react-admin/issues/6270#issuecomment-1126962443
I’ll be happy to close this issue and re-open if I notice this behaviour in v4
@andrico1234 the behavior I reported before is for v4, so here is a new one! 😃
What you were expecting:
Using both global and input level validations on a same form should merge the behavior.
What happened instead:
Only the global validation is executed
Steps to reproduce:
make run-simple
- Go to http://localhost:8080/#/comments/create
- Fill the “Author” field with
foo
- Submit the form
The “Author” form should trigger an error because of minLength(10)
input level configuration.
Related code:
https://github.com/pocivaneuh/react-admin/pull/2
Other information:
Environment
- React-admin version: v4
- Last version that did not exhibit the issue (if applicable): v3
- React version: v17
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Input validation errors: The root of all evil in web application ...
Input validation is the first step in sanitizing the type and content of data supplied by a user or application. Missing or improper...
Read more >Restrict data input by using validation rules - Microsoft Support
When data is entered, Access checks to see whether the input breaks a validation rule – if so, the input is not accepted,...
Read more >Form Validation - React-admin - Marmelab
React-admin will combine all the input-level functions into a single function looking just like the previous one. Input validation functions receive the current ......
Read more >CWE-20: Improper Input Validation (4.9) - MITRE
Input validation is not the only technique for processing input, ... Base level weaknesses typically describe issues in terms of 2 or 3...
Read more >Global Validators - VeeValidate
You can define a global validator using the defineRule function exported by ... The Form-level validation feature isn't limited to yup validators, you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/marmelab/react-admin/pull/7726 has been merged and fixes the documentation part.
Keeping this open as an enhancement request.
I agree. I’ll reopen this as an enhancement feature so that we can discuss with the team what we can do about this.