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
I have a form with 2 inputs, both inputs are required but the second is disabled if there is no value for the first input, after I provide a value for the first input the second input becomes enabled but if I submit the form without providing a value for second input the form submission should failed because the required() should fail, What happened instead:
The form was submitted and ignored the fact that there is no value on a required() validation input. Steps to reproduce:
1.Go to create post,
Fill in the required fields but leave the average_note blank, it is required() and minimum 1 but it can submit the form without providing value for it
**Environment**
* React-admin version:4.16.18
* Last version that did not exhibit the issue (if applicable):
* React version:17.0
* Browser:Chrome
* Stack trace (in case of a JS error):
The text was updated successfully, but these errors were encountered:
@endrits079 we had issues in the past with a breaking change introduced by RHF in version 7.47.0 which affected disabled inputs. That's why we made sure the readOnly prop is supported on every input component in react-admin (#9656).
If using readOnly allows to fix the problem, we will consider this issue solved.
If using readOnly cannot be applied in your case, feel free to elaborate.
What you were expecting:
I have a form with 2 inputs, both inputs are required but the second is disabled if there is no value for the first input, after I provide a value for the first input the second input becomes enabled but if I submit the form without providing a value for second input the form submission should failed because the required() should fail,
What happened instead:
The form was submitted and ignored the fact that there is no value on a required() validation input.
Steps to reproduce:
1.Go to create post,
Fill in the required fields but leave the average_note blank, it is required() and minimum 1 but it can submit the form without providing value for it
Related code:
https://stackblitz.com/edit/github-xm5t9q?file=src%2Fposts%2FPostCreate.tsx
The text was updated successfully, but these errors were encountered: