question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Global and input level validation can not be combined

See original GitHub issue

This 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:

  1. make run-simple
  2. Go to http://localhost:8080/#/comments/create
  3. Fill the “Author” field with foo
  4. 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:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
slax57commented, May 23, 2022

https://github.com/marmelab/react-admin/pull/7726 has been merged and fixes the documentation part.

Keeping this open as an enhancement request.

1reaction
slax57commented, May 19, 2022

I agree. I’ll reopen this as an enhancement feature so that we can discuss with the team what we can do about this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found